Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#861 closed defect (fixed)

[patch] fix appearance of combobox option list

Reported by: mattimustang@… Owned by: anonymous
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Combobox Cc: mattimustang@…
Blocked By: Blocking:

Description

This small patch aligns the right edge of the combobox dropdown with the rest of the widget and improves it appearance:

In {{src/widget/html/ComboBox.js}} change:

    showResultList: function(){
        // Our dear friend IE doesnt take max-height so we need to calculate that on our own every time
        var childs = this.optionsListNode.childNodes;
        if(childs.length){
            var visibleCount = this.maxListLength;
            if(childs.length < visibleCount){
                visibleCount = childs.length;
            }

            with(this.optionsListNode.style){
                display = "";
                height = ((visibleCount) ? (dojo.style.getOuterHeight(childs[0]) * visibleCount) : 0)+"px";
                width = dojo.html.getOuterWidth(this.cbTableNode)+"px";
            }
            // only fadein once (flicker)
            if(!this._result_list_open){
                dojo.html.setOpacity(this.optionsListNode, 0);
                dojo.lfx.fadeIn(this.optionsListNode, 200).play();
            }

            // prevent IE bleed through
            this._iframeTimer = dojo.lang.setTimeout(this, "sizeBackgroundIframe", 200);
            this._result_list_open = true;
        }else{
            this.hideResultList();
        }
    },

to subtract 2 pixels from the width of the optionsListNode:

    showResultList: function(){
        // Our dear friend IE doesnt take max-height so we need to calculate that on our own every time
        var childs = this.optionsListNode.childNodes;
        if(childs.length){
            var visibleCount = this.maxListLength;
            if(childs.length < visibleCount){
                visibleCount = childs.length;
            }

            with(this.optionsListNode.style){
                display = "";
                height = ((visibleCount) ? (dojo.style.getOuterHeight(childs[0]) * visibleCount) : 0)+"px";
                width = dojo.html.getOuterWidth(this.cbTableNode)-2+"px";
            }
            // only fadein once (flicker)
            if(!this._result_list_open){
                dojo.html.setOpacity(this.optionsListNode, 0);
                dojo.lfx.fadeIn(this.optionsListNode, 200).play();
            }

            // prevent IE bleed through
            this._iframeTimer = dojo.lang.setTimeout(this, "sizeBackgroundIframe", 200);
            this._result_list_open = true;
        }else{
            this.hideResultList();
        }
    },

Change History (2)

comment:1 Changed 13 years ago by bill

Resolution: fixed
Status: newclosed

Fixed in [4230]

comment:2 Changed 12 years ago by (none)

Milestone: 0.3.1

Milestone 0.3.1 deleted

Note: See TracTickets for help on using tickets.