Bug 817539 - [toolbox] close the responsive mode on ESC, even if toolbox is up, r=vporof
--- a/browser/devtools/responsivedesign/responsivedesign.jsm
+++ b/browser/devtools/responsivedesign/responsivedesign.jsm
@@ -153,19 +153,16 @@ function ResponsiveUI(aWindow, aTab)
// Events
this.tab.addEventListener("TabClose", this);
this.tabContainer.addEventListener("TabSelect", this);
this.mainWindow.document.addEventListener("keypress", this.bound_onKeypress, false);
this.buildUI();
this.checkMenus();
- let target = TargetFactory.forTab(this.tab);
- this.toolboxWasOpen = !!gDevTools.getToolbox(target);
-
try {
if (Services.prefs.getBoolPref("devtools.responsiveUI.rotate")) {
this.rotate();
}
} catch(e) {}
if (this._floatingScrollbars)
switchToFloatingScrollbars(this.tab);
@@ -234,27 +231,19 @@ ResponsiveUI.prototype = {
* Handle keypressed.
*
* @param aEvent
*/
onKeypress: function RUI_onKeypress(aEvent) {
if (aEvent.keyCode == this.mainWindow.KeyEvent.DOM_VK_ESCAPE &&
this.mainWindow.gBrowser.selectedBrowser == this.browser) {
- // If the toolbox wasn't open at first but is open now,
- // we don't want to close the Responsive Mode on Escape.
- // We let the toolbox close first.
-
- let target = TargetFactory.forTab(this.tab);
- let isToolboxOpen = !!gDevTools.getToolbox(target);
- if (this.toolboxWasOpen || !isToolboxOpen) {
- aEvent.preventDefault();
- aEvent.stopPropagation();
- this.close();
- }
+ aEvent.preventDefault();
+ aEvent.stopPropagation();
+ this.close();
}
},
/**
* Handle events
*/
handleEvent: function (aEvent) {
switch (aEvent.type) {