From b011da6386e70a904d2d670cbaf62740750609ab Mon Sep 17 00:00:00 2001 From: "doronr%us.ibm.com" Date: Thu, 23 Jun 2005 20:04:57 +0000 Subject: [PATCH] Bug 298524 - Add init() method to richlistbox. r=robstrong,mconnor a=bsmedberg --- toolkit/content/widgets/richlistbox.xml | 186 ++++++++++-------- .../mozapps/extensions/content/extensions.js | 11 +- 2 files changed, 109 insertions(+), 88 deletions(-) diff --git a/toolkit/content/widgets/richlistbox.xml b/toolkit/content/widgets/richlistbox.xml index 9788064fdc52..5dc1c1c43f09 100644 --- a/toolkit/content/widgets/richlistbox.xml +++ b/toolkit/content/widgets/richlistbox.xml @@ -64,14 +64,14 @@ - + @@ -87,7 +87,7 @@ ]]> - + null @@ -102,69 +102,102 @@ if (val) { val.selected = true; - this.scrollBoxObject.ensureElementIsVisible(val); + this.scrollBoxObject.scrollToElement(val); this.fireActiveItemEvent(); } this.fireEvent("select"); - ]]> + ]]> - + - + return false; + ]]> - + return false; + ]]> + + + + + + + + + + + + + + + + + + + - + var handler = this.getAttribute("onrichview-" + aEventType); + if (handler != "") { + var fn = new Function("event", handler); + fn(e); + } + document.commandDispatcher.updateCommands(eventType); + ]]> @@ -175,25 +208,25 @@ - + - + - @@ -208,15 +241,6 @@ - - - @@ -225,9 +249,9 @@ return accService.createXULListitemAccessible(this); ]]> - + - + @@ -253,21 +277,23 @@ ]]> - + - + + + diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 0514d72d762d..43d102b98596 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -187,14 +187,9 @@ function Startup() optionsButton.hidden = true; } - // Restore the last-selected extension - var lastSelected = gExtensionsView.getAttribute("last-selected"); - if (lastSelected != "") - lastSelected = document.getElementById(lastSelected); - if (!lastSelected) - gExtensionsView.goDown(); - else - gExtensionsView.selectedItem = lastSelected; + // Initialize the richlistbox. This will select the last selected extension + // or default to the first listed one. + gExtensionsView.init(); var extensionsStrings = document.getElementById("extensionsStrings"); document.title = extensionsStrings.getString(gWindowState + "Title");