Bug 1297288 - Prevent all toolbox key shortcuts from triggering Firefox equivalents. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 31 Aug 2016 07:07:44 -0700
changeset 312017 dd07b7887914bf4a8b20301109f5189473bb3aaa
parent 312016 b38f935eb81130e8a1bb3b559efd8e30af3895a3
child 312018 135621463dac620d51a8a975f9ef9caf2bfca934
push id20425
push userapoirot@mozilla.com
push dateWed, 31 Aug 2016 14:09:44 +0000
treeherderfx-team@dd07b7887914 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1297288
milestone51.0a1
Bug 1297288 - Prevent all toolbox key shortcuts from triggering Firefox equivalents. r=jryans
devtools/client/framework/toolbox.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -599,21 +599,30 @@ Toolbox.prototype = {
         // Prevent Firefox shortcuts from reloading the page
         event.preventDefault();
       });
     });
   },
 
   _addHostListeners: function (shortcuts) {
     shortcuts.on(L10N.getStr("toolbox.nextTool.key"),
-                 this.selectNextTool.bind(this));
+                 (name, event) => {
+                   this.selectNextTool();
+                   event.preventDefault();
+                 });
     shortcuts.on(L10N.getStr("toolbox.previousTool.key"),
-                 this.selectPreviousTool.bind(this));
+                 (name, event) => {
+                   this.selectPreviousTool();
+                   event.preventDefault();
+                 });
     shortcuts.on(L10N.getStr("toolbox.minimize.key"),
-                 this._toggleMinimizeMode.bind(this));
+                 (name, event) => {
+                   this._toggleMinimizeMode();
+                   event.preventDefault();
+                 });
     shortcuts.on(L10N.getStr("toolbox.toggleHost.key"),
                  (name, event) => {
                    this.switchToPreviousHost();
                    event.preventDefault();
                  });
 
     this.doc.addEventListener("keypress", this._splitConsoleOnKeypress, false);