From 125526fd5b1e6afb3f60561d4855ea3257f30d72 Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Wed, 26 Jun 2013 23:35:38 +0300 Subject: [PATCH] Bug 887177 - Right clicking on a network request should select it, r=rcampbell --- browser/devtools/netmonitor/netmonitor-view.js | 1 + browser/devtools/shared/widgets/ViewHelpers.jsm | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/browser/devtools/netmonitor/netmonitor-view.js b/browser/devtools/netmonitor/netmonitor-view.js index afdd1e59fc4..00125227ca4 100644 --- a/browser/devtools/netmonitor/netmonitor-view.js +++ b/browser/devtools/netmonitor/netmonitor-view.js @@ -278,6 +278,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { this.widget = new SideMenuWidget($("#requests-menu-contents"), false); this._summary = $("#request-menu-network-summary"); + this.allowFocusOnRightClick = true; this.widget.maintainSelectionVisible = false; this.widget.autoscrollWithAppendedItems = true; diff --git a/browser/devtools/shared/widgets/ViewHelpers.jsm b/browser/devtools/shared/widgets/ViewHelpers.jsm index 848fabd895f..167f9e8710e 100644 --- a/browser/devtools/shared/widgets/ViewHelpers.jsm +++ b/browser/devtools/shared/widgets/ViewHelpers.jsm @@ -1025,6 +1025,12 @@ this.WidgetMethods = { */ autoFocusOnInput: true, + /** + * When focusing on input, allow right clicks? + * @see WidgetMethods.autoFocusOnInput + */ + allowFocusOnRightClick: false, + /** * The number of elements in this container to jump when Page Up or Page Down * keys are pressed. If falsy, then the page size will be based on the @@ -1541,12 +1547,12 @@ this.WidgetMethods = { }, /** - * The keyPress event listener for this container. + * The mousePress event listener for this container. * @param string aName * @param MouseEvent aEvent */ _onWidgetMousePress: function(aName, aEvent) { - if (aEvent.button != 0) { + if (aEvent.button != 0 && !this.allowFocusOnRightClick) { // Only allow left-click to trigger this event. return; }