Bug 817539 - [toolbox] close the responsive mode on ESC, even if toolbox is up, r=vporof

This commit is contained in:
Paul Rouget 2012-12-16 11:14:15 +02:00
parent 0d9d123370
commit 644d5fd0a2

View File

@ -158,9 +158,6 @@ function ResponsiveUI(aWindow, aTab)
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();
@ -239,17 +236,9 @@ ResponsiveUI.prototype = {
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();
}
},