Bug 1346647 - Fix RDM button for undocked toolbox. r=ochameau
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 14 Mar 2017 18:41:23 -0500
changeset 348297 576abf29e19cefe2a68f053245d81a65df46c99b
parent 348296 048e51956b6cda9b275a2506acc535f64dac4480
child 348298 5057a244f6b520bb8124678e5544e75582122e13
push id88187
push userarchaeopteryx@coole-files.de
push dateSat, 18 Mar 2017 15:27:00 +0000
treeherdermozilla-inbound@0b1d3324cffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1346647
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1346647 - Fix RDM button for undocked toolbox. r=ochameau MozReview-Commit-ID: 15axErkUY1E
devtools/client/definitions.js
--- a/devtools/client/definitions.js
+++ b/devtools/client/definitions.js
@@ -506,21 +506,20 @@ exports.ToolboxButtons = [
       ScratchpadManager.openScratchpad();
     }
   },
   { id: "command-button-responsive",
     description: l10n("toolbox.buttons.responsive",
                       osString == "Darwin" ? "Cmd+Opt+M" : "Ctrl+Shift+M"),
     isTargetSupported: target => target.isLocalTab,
     onClick(event, toolbox) {
-      let browserWindow = toolbox.win.top;
-      ResponsiveUIManager.handleGcliCommand(browserWindow,
-        browserWindow.gBrowser.selectedTab,
-        "resize toggle",
-        null);
+      let tab = toolbox.target.tab;
+      let browserWindow = tab.ownerDocument.defaultView;
+      ResponsiveUIManager.handleGcliCommand(browserWindow, tab,
+        "resize toggle", null);
     },
     isChecked(toolbox) {
       if (!toolbox.target.tab) {
         return false;
       }
       return ResponsiveUIManager.isActiveForTab(toolbox.target.tab);
     },
     setup(toolbox, onChange) {