From 5908271274903edb08672a2ed0c26d88a6d0b737 Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Sun, 14 Oct 2007 01:26:26 +0000 Subject: [PATCH] Bug 398469: Ctrl+Up/Down doesn't work to change engines, r+a=mconnor git-svn-id: svn://10.0.0.236/trunk@237728 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/search/content/search.xml | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/mozilla/browser/components/search/content/search.xml b/mozilla/browser/components/search/content/search.xml index 2cc2dd7f58a..82d8bac24bf 100644 --- a/mozilla/browser/components/search/content/search.xml +++ b/mozilla/browser/components/search/content/search.xml @@ -161,6 +161,14 @@ null null + + + + = 0; --i) { + var engines = this.engines; + for (var i = engines.length - 1; i >= 0; --i) { var menuitem = document.createElementNS(kXULNS, "menuitem"); - var name = this._engines[i].name; + var name = engines[i].name; menuitem.setAttribute("label", name); menuitem.setAttribute("id", name); menuitem.setAttribute("class", "menuitem-iconic searchbar-engine-menuitem"); // Since this menu is rebuilt by the observer method whenever a new // engine is selected, the "selected" attribute does not need to be // explicitly cleared anywhere. - if (this._engines[i] == this.currentEngine) + if (engines[i] == this.currentEngine) menuitem.setAttribute("selected", "true"); var tooltip = this._stringBundle.getFormattedString("searchtip", [name]); menuitem.setAttribute("tooltiptext", tooltip); - if (this._engines[i].iconURI) - menuitem.setAttribute("src", this._engines[i].iconURI.spec); + if (engines[i].iconURI) + menuitem.setAttribute("src", engines[i].iconURI.spec); popup.insertBefore(menuitem, popup.firstChild); - menuitem.engine = this._engines[i]; + menuitem.engine = engines[i]; } this._needToBuildPopup = false; @@ -483,11 +493,11 @@ = 0 && newIndex < this._engines.length) - this.currentEngine = this._engines[newIndex]; + if (newIndex >= 0 && newIndex < this.engines.length) + this.currentEngine = this.engines[newIndex]; aEvent.preventDefault(); aEvent.stopPropagation();