mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 691884 - Pressing Escape 'Esc' should close developer 'Inspect' mode; r=rcampbell
This commit is contained in:
parent
86ea298eb5
commit
03992dd35e
@ -26,6 +26,7 @@
|
||||
* Julian Viereck <jviereck@mozilla.com>
|
||||
* Paul Rouget <paul@mozilla.com>
|
||||
* Kyle Simpson <ksimpson@mozilla.com>
|
||||
* Johan Charlez <johan.charlez@gmail.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -1112,8 +1113,8 @@ InspectorUI.prototype = {
|
||||
this.inspectToolbutton.checked = false;
|
||||
// Detach event listeners from content window and child windows to disable
|
||||
// highlighting. We still want to be notified if the user presses "ESCAPE"
|
||||
// to unlock the node, so we don't remove the "keypress" event until
|
||||
// the highlighter is removed.
|
||||
// to close the inspector, or "RETURN" to unlock the node, so we don't
|
||||
// remove the "keypress" event until the highlighter is removed.
|
||||
this.highlighter.detachInspectListeners();
|
||||
|
||||
this.inspecting = false;
|
||||
@ -1248,8 +1249,12 @@ InspectorUI.prototype = {
|
||||
break;
|
||||
case "keypress":
|
||||
switch (event.keyCode) {
|
||||
case this.chromeWin.KeyEvent.DOM_VK_RETURN:
|
||||
case this.chromeWin.KeyEvent.DOM_VK_ESCAPE:
|
||||
this.closeInspectorUI(false);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
case this.chromeWin.KeyEvent.DOM_VK_RETURN:
|
||||
this.toggleInspection();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
@ -44,7 +44,7 @@ function test()
|
||||
Services.obs.removeObserver(lockNode,
|
||||
InspectorUI.INSPECTOR_NOTIFICATIONS.HIGHLIGHTING);
|
||||
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", { });
|
||||
EventUtils.synthesizeKey("VK_RETURN", { });
|
||||
|
||||
executeSoon(isTheNodeLocked);
|
||||
}
|
||||
@ -57,7 +57,7 @@ function test()
|
||||
}
|
||||
|
||||
function unlockNode() {
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", { });
|
||||
EventUtils.synthesizeKey("VK_RETURN", { });
|
||||
|
||||
executeSoon(isTheNodeUnlocked);
|
||||
}
|
||||
@ -66,9 +66,12 @@ function test()
|
||||
{
|
||||
ok(InspectorUI.inspecting, "the node is unlocked");
|
||||
|
||||
// Let's close the inspector
|
||||
Services.obs.addObserver(finishUp,
|
||||
InspectorUI.INSPECTOR_NOTIFICATIONS.CLOSED, false);
|
||||
InspectorUI.closeInspectorUI();
|
||||
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", {});
|
||||
ok(true, "Inspector is closing successfuly");
|
||||
}
|
||||
|
||||
function finishUp() {
|
||||
|
Loading…
Reference in New Issue
Block a user