Index: src/main/resources/org/karora/cooee/ng/ui/resource/js/combobox.js =================================================================== --- src/main/resources/org/karora/cooee/ng/ui/resource/js/combobox.js (revision 928) +++ src/main/resources/org/karora/cooee/ng/ui/resource/js/combobox.js Mon Feb 04 18:40:31 EET 2008 @@ -70,7 +70,8 @@ EPComboBox.MessageProcessor.processDispose = function(disposeMessageElement) { for (var item = disposeMessageElement.firstChild; item; item = item.nextSibling) { - EP.ObjectMap.destroy(elementId) + "|Combo"; + var comboId = elementId + "|Combo"; + EP.ObjectMap.destroy(comboId); } }; @@ -104,7 +105,7 @@ combo.defaultHoverStyle = item.getAttribute("defaultHoverStyle"); combo.defaultItemStyle = item.getAttribute("defaultItemStyle"); combo.textMatching = item.getAttribute("textMatching") == "true"; - combo.visibleRows = parseInt(item.getAttribute("visibleRows")); + combo.visibleRows = parseInt(item.getAttribute("visibleRows"), 10); // Add event handlers to various elements of the ComboBox combo.eOuter = popup.eOuter; @@ -304,7 +305,7 @@ // delegate visibility handling to popup click handler var popup = EP.ObjectMap.get(this.popupId); if (popup.isExpanded()) { - popup.togglePopup(echoEvent, true) + popup.togglePopup(echoEvent, true); //popup.onclick(echoEvent); } }; @@ -319,7 +320,7 @@ // delegate visibility handling to popup click handler var popup = EP.ObjectMap.get(this.popupId); if (!popup.isExpanded()) { - popup.togglePopup(echoEvent) + popup.togglePopup(echoEvent); //popup.onclick(echoEvent); } }; @@ -330,20 +331,21 @@ // dont include padding or borders. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EPComboBox.prototype.adjustSize = function() { + EP.setDisplayed(this.eBox, true); - - var rows = this.getListBoxRows(); + + var rows = this.getListBoxRows(); // Get width of parent control, subtracting the listBox's padding & borders // This will make the list line up with the parent unless it needs to be wider var wParent = EP.getWidth(this.eOuter); var s = this.eBox.style; - wParent -= parseInt(s.borderLeftWidth); - wParent -= parseInt(s.borderRightWidth); - wParent -= parseInt(s.paddingLeft); - wParent -= parseInt(s.paddingRight); + wParent -= parseInt(s.borderLeftWidth, 10); + wParent -= parseInt(s.borderRightWidth, 10); + wParent -= parseInt(s.paddingLeft, 10); + wParent -= parseInt(s.paddingRight, 10); // fudge factor to allow room for vertical scrollbar on browsers that insert it over content - var wScroll = (this.options.length > rows && !EP.isIE) ? 20 : 0; + var wScroll = (this.options.length > rows) ? 20 : 0; var wBox = EP.getWidth(this.eBox) + wScroll; EP.setWidth(this.eBox, Math.max(wBox, wParent) + "px"); @@ -357,7 +359,7 @@ var start = (this.selectedIndex > 0 ? this.selectedIndex : 0); var end = Math.min(start + rows, this.options.length) - 1; start += (end - start + 1 - rows); - + var top = EP.getY(this.options[start]); var option = this.options[end]; var bot = EP.getY(option) + EP.getHeight(option); @@ -405,10 +407,10 @@ // we only want content height var listHeight = EP.getHeight(this.eBox); var s = this.eBox.style; - listHeight -= parseInt(s.borderTopWidth); - listHeight -= parseInt(s.borderBottomWidth); - listHeight -= parseInt(s.paddingTop); - listHeight -= parseInt(s.paddingBottom); + listHeight -= parseInt(s.borderTopWidth, 10); + listHeight -= parseInt(s.borderBottomWidth, 10); + listHeight -= parseInt(s.paddingTop, 10); + listHeight -= parseInt(s.paddingBottom, 10); var option = this.options[this.selectedIndex]; var optHeight = EP.getHeight(option);