Bug 1102961 - Cannot navigate AMO without closing the Options window. r=florian, a=sledru
authorAbdelrhman Ahmed <a.ahmed1026@gmail.com>
Sun, 11 Jan 2015 20:51:11 +0100
changeset 242867 5ac62d0df17e
parent 242866 82cce51fb174
child 242868 4d3d7478ffa4
push id4323
push userryanvm@gmail.com
push date2015-01-14 15:46 +0000
treeherdermozilla-beta@19e248751a1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, sledru
bugs1102961
milestone36.0
Bug 1102961 - Cannot navigate AMO without closing the Options window. r=florian, a=sledru
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>