Bug 1102961 - Cannot navigate AMO without closing the Options window, r=florian.
authorAbdelrhman Ahmed <a.ahmed1026@gmail.com>
Sun, 11 Jan 2015 20:51:11 +0100
changeset 223099 4f0b4498fae5b14b7444bb539cfcfa0a41c543ab
parent 223098 9eb7ebdb6f6ec96295fa19a93595934c6aeb2445
child 223100 3c61d595997e4b80a1eb5e385e7b0ca3fd7d9d96
push id10762
push userflorian@queze.net
push dateSun, 11 Jan 2015 19:51:35 +0000
treeherderfx-team@3c61d595997e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1102961
milestone37.0a1
Bug 1102961 - Cannot navigate AMO without closing the Options window, r=florian.
browser/components/preferences/search.js
browser/components/preferences/search.xul
--- a/browser/components/preferences/search.js
+++ b/browser/components/preferences/search.js
@@ -175,16 +175,21 @@ var gSearchPane = {
       hiddenList.join(",");
   },
 
   setDefaultEngine: function () {
     if (document.documentElement.instantApply) {
       Services.search.currentEngine =
         document.getElementById("defaultEngine").selectedItem.engine;
     }
+  },
+
+  loadAddEngines: function () {
+    window.opener.BrowserSearch.loadAddEngines();
+    window.document.documentElement.acceptDialog();
   }
 };
 
 function onDragEngineStart(event) {
   var selectedIndex = gEngineView.selectedIndex;
   if (selectedIndex >= 0) {
     event.dataTransfer.setData(ENGINE_FLAVOR, selectedIndex.toString());
     event.dataTransfer.effectAllowed = "move";
--- a/browser/components/preferences/search.xul
+++ b/browser/components/preferences/search.xul
@@ -77,15 +77,15 @@
                 disabled="true"
                 oncommand="gSearchPane.remove();"/>
       </hbox>
 
       <separator class="thin"/>
 
       <hbox pack="start">
         <label id="addEngines" class="text-link" value="&addMoreSearchEngines.label;"
-               onclick="if (event.button == 0) { Services.wm.getMostRecentWindow('navigator:browser').BrowserSearch.loadAddEngines(); }"/>
+               onclick="if (event.button == 0) { gSearchPane.loadAddEngines(); }"/>
       </hbox>
     </groupbox>
 
   </prefpane>
 
 </overlay>