From 034e7cd43ee4f16c30ce658f5d21247aab3e2808 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Sat, 14 Dec 2002 00:14:54 +0000 Subject: [PATCH] Fix menulist selection and other problems; fix by neil@parkwaycc.co.uk, r=cmanske, sr=dveditz git-svn-id: svn://10.0.0.236/trunk@135271 18797224-902f-48f8-a5cc-f745e15eee43 --- .../resources/content/bindings/menulist.xml | 280 ++++++++---------- 1 file changed, 126 insertions(+), 154 deletions(-) diff --git a/mozilla/xpfe/global/resources/content/bindings/menulist.xml b/mozilla/xpfe/global/resources/content/bindings/menulist.xml index 1696086476b..2a00e2141bc 100644 --- a/mozilla/xpfe/global/resources/content/bindings/menulist.xml +++ b/mozilla/xpfe/global/resources/content/bindings/menulist.xml @@ -25,16 +25,14 @@ + action="if (event.target.parentNode.parentNode == this) this.selectedItem = event.target;"/> @@ -49,22 +47,17 @@ @@ -73,10 +66,10 @@ - + + + + + + + + + + this.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject) + null @@ -112,29 +119,27 @@ @@ -178,16 +183,14 @@ @@ -198,20 +201,17 @@ @@ -220,11 +220,10 @@ + + + + + + - - + @@ -265,18 +275,16 @@ return ""; // Find and select the menuitem that matches inputField's "value" - var inputVal = this.inputField.value; - var arr; + var arr = null; + var popup = this.menupopup; - if (this.childNodes.length) - arr = this.firstChild.getElementsByAttribute('label', inputVal); + if (popup) + arr = popup.getElementsByAttribute('label', this.inputField.value); if (arr && arr.length) this.setSelectionInternal(arr[0]); else this.setSelectionInternal(null); - - return inputVal; ]]> @@ -296,35 +304,25 @@ this.selectedInternal = val; - //Do NOT change the "value", which is owned by inputField - if (!this.selectedInternal) { - this.removeAttribute('src'); - return val; - } - val.setAttribute('selected', 'true'); - this.setAttribute('src', val.getAttribute('src')); + if (val) + val.setAttribute('selected', 'true'); + //Do NOT change the "value", which is owned by inputField return val; ]]> - - 0) { - input = l[0]; - break; - } - } catch (e) {} - } - input; - ]]> - + null + + + + + @@ -378,82 +376,56 @@ else this.removeAttribute('disableautoselect'); return val;" onget="return this.hasAttribute('disableautoselect');"/> - - - - - - - - + + + this.inputField.select(); + + - + - + ]]>