Bug 1287474 - Remove uneeded keyboard handler. r=Honza
authorNancy Pang <npang@mozilla.com>
Mon, 18 Jul 2016 12:00:25 -0400
changeset 331214 df9ca53bc33cc501572da85fa4f3171aa2c668ba
parent 331213 7436d69f220b218af483cd88932f6a497f41c349
child 331215 7e5277f1cf65210e13f10a94e7f938ce703eac9f
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1287474
milestone50.0a1
Bug 1287474 - Remove uneeded keyboard handler. r=Honza MozReview-Commit-ID: 41UNnQGPom7
devtools/client/inspector/inspector-panel.js
--- a/devtools/client/inspector/inspector-panel.js
+++ b/devtools/client/inspector/inspector-panel.js
@@ -93,18 +93,17 @@ function InspectorPanel(iframeWindow, to
 
   this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
   this.onNewRoot = this.onNewRoot.bind(this);
   this._onContextMenu = this._onContextMenu.bind(this);
   this._updateSearchResultsLabel = this._updateSearchResultsLabel.bind(this);
   this.onNewSelection = this.onNewSelection.bind(this);
   this.onBeforeNewSelection = this.onBeforeNewSelection.bind(this);
   this.onDetached = this.onDetached.bind(this);
-  this.onPaneToggleButtonActivated = this.onPaneToggleButtonActivated.bind(this);
-  this.onPaneToggleButtonPressed = this.onPaneToggleButtonPressed.bind(this);
+  this.onPaneToggleButtonClicked = this.onPaneToggleButtonClicked.bind(this);
   this._onMarkupFrameLoad = this._onMarkupFrameLoad.bind(this);
 
   let doc = this.panelDoc;
 
   // Handle 'Add Node' toolbar button.
   this.addNode = this.addNode.bind(this);
   this.addNodeButton = doc.getElementById("inspector-element-add-button");
   this.addNodeButton.addEventListener("click", this.addNode);
@@ -504,18 +503,17 @@ InspectorPanel.prototype = {
   /**
    * Add the expand/collapse behavior for the sidebar panel.
    */
   setupSidebarToggle: function () {
     let SidebarToggle = this.React.createFactory(this.browserRequire(
       "devtools/client/shared/components/sidebar-toggle"));
 
     let sidebarToggle = SidebarToggle({
-      onClick: this.onPaneToggleButtonActivated,
-      onKeyDown: this.onPaneToggleButtonPressed,
+      onClick: this.onPaneToggleButtonClicked,
       collapsed: false,
       expandPaneTitle: strings.GetStringFromName("inspector.expandPane"),
       collapsePaneTitle: strings.GetStringFromName("inspector.collapsePane"),
     });
 
     let parentBox = this.panelDoc.getElementById("inspector-sidebar-toggle-box");
     this._sidebarToggle = this.ReactDOM.render(sidebarToggle, parentBox);
   },
@@ -1208,30 +1206,20 @@ InspectorPanel.prototype = {
     }
 
     this._markupBox = null;
 
     return destroyPromise;
   },
 
   /**
-  * When the pane toggle button is pressed with space and return keys toggle
-  * the pane, change the button state and tooltip.
-  */
-  onPaneToggleButtonPressed: function (event) {
-    if (ViewHelpers.isSpaceOrReturn(event)) {
-      this.onPaneToggleButtonActivated(event);
-    }
-  },
-
-  /**
-   * When the pane toggle button is clicked, toggle the pane, change the button
+   * When the pane toggle button is clicked or pressed, toggle the pane, change the button
    * state and tooltip.
    */
-  onPaneToggleButtonActivated: function (e) {
+  onPaneToggleButtonClicked: function (e) {
     let sidePaneContainer = this.panelDoc.querySelector("#inspector-sidebar-container");
     let isVisible = !this._sidebarToggle.state.collapsed;
 
     // Make sure the sidebar has width and height attributes before collapsing
     // because ViewHelpers needs it.
     if (isVisible) {
       let rect = sidePaneContainer.getBoundingClientRect();
       if (!sidePaneContainer.hasAttribute("width")) {