Backed out changeset 7ee849f1c0c4 (bug 1003153) for devtools bustage on a CLOSED TREE

This commit is contained in:
Wes Kocher 2014-08-18 15:24:53 -07:00
parent e08f9ba6c3
commit fe3c309bfd
3 changed files with 5 additions and 64 deletions

View File

@ -75,7 +75,6 @@ let NetMonitorView = {
this.RequestsMenu.initialize();
this.NetworkDetails.initialize();
this.CustomRequest.initialize();
this.arrowClosed = false;
},
/**
@ -309,16 +308,12 @@ ToolbarView.prototype = {
let requestsMenu = NetMonitorView.RequestsMenu;
let selectedIndex = requestsMenu.selectedIndex;
// Allow opening the sidebar if it was previously closed with an arrow key.
requestsMenu.arrowClosed = false;
// Make sure there's a selection if the button is pressed, to avoid
// showing an empty network details pane.
// If there is a selection, toggle the sidebar.
if (selectedIndex == -1 && requestsMenu.itemCount) {
requestsMenu.selectedIndex = 0;
} else {
NetMonitorView.Sidebar.toggle(NetMonitorView.detailsPaneHidden);
requestsMenu.selectedIndex = -1;
}
},
@ -390,9 +385,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
$("#request-menu-context-copy-url").addEventListener("command", this._onContextCopyUrlCommand, false);
$("#request-menu-context-copy-image-as-data-uri").addEventListener("command", this._onContextCopyImageAsDataUriCommand, false);
this.ignoreLeftRight = true;
this.widget.on("keyPress", this._handleKeyPress.bind(this));
window.once("connected", this._onConnect.bind(this));
},
@ -741,29 +733,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
}
},
/**
* Handler to allow keyboard controls to close the Sidebar.
* Left|Return: open
* Right: close
*
* @param string aName
* Name of the Event
* @param nsIDOMEvent aEvent
*/
_handleKeyPress: function(aName, aEvent) {
switch (aEvent.keyCode) {
case aEvent.DOM_VK_RETURN:
case aEvent.DOM_VK_LEFT:
NetMonitorView.Sidebar.toggle(true);
this.arrowClosed = false;
return;
case aEvent.DOM_VK_RIGHT:
NetMonitorView.Sidebar.toggle(false);
this.arrowClosed = true;
return;
}
},
/**
* Returns a predicate that can be used to test if a request matches any of
* the active filters.
@ -1577,10 +1546,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* The selection listener for this container.
*/
_onSelect: function({ detail: item }) {
if (this.arrowClosed) {
return;
}
if (item) {
NetMonitorView.Sidebar.populate(item.attachment);
NetMonitorView.Sidebar.toggle(true);

View File

@ -25,11 +25,6 @@ function test() {
EventUtils.sendKey("UP", window);
check(0, true);
EventUtils.sendKey("RIGHT", window);
check(0, false);
EventUtils.sendKey("LEFT", window);
check(0, true);
EventUtils.sendKey("PAGE_DOWN", window);
check(1, true);
EventUtils.sendKey("PAGE_UP", window);
@ -57,24 +52,16 @@ function test() {
check(4, true);
EventUtils.sendKey("PAGE_DOWN", window);
check(8, true);
EventUtils.sendKey("RIGHT", window);
check(8, false);
EventUtils.sendKey("PAGE_UP", window);
check(4, false);
EventUtils.sendKey("LEFT", window);
check(4, true);
EventUtils.sendKey("PAGE_UP", window);
check(0, true);
EventUtils.sendKey("HOME", window);
check(0, true);
EventUtils.sendKey("RIGHT", window);
check(0, false);
EventUtils.sendKey("HOME", window);
check(0, false);
check(0, true);
EventUtils.sendKey("PAGE_UP", window);
check(0, false);
EventUtils.sendKey("RETURN", window);
check(0, true);
EventUtils.sendKey("HOME", window);
check(0, true);
@ -115,7 +102,7 @@ function test() {
check(19, true);
EventUtils.sendMouseEvent({ type: "mousedown" }, $("#details-pane-toggle"));
check(19, false);
check(-1, false);
EventUtils.sendMouseEvent({ type: "mousedown" }, $(".side-menu-widget-item"));
check(0, true);

View File

@ -1181,13 +1181,6 @@ this.WidgetMethods = {
*/
autoFocusOnInput: true,
/**
* Ignore Left and Right keypresses.
*
* If this flag is set to true, Widgets should implement their own handler.
*/
ignoreLeftRight: false,
/**
* When focusing on input, allow right clicks?
* @see WidgetMethods.autoFocusOnInput
@ -1641,16 +1634,12 @@ this.WidgetMethods = {
switch (aEvent.keyCode) {
case aEvent.DOM_VK_UP:
case aEvent.DOM_VK_LEFT:
this.focusPrevItem();
return;
case aEvent.DOM_VK_DOWN:
this.focusNextItem();
return;
case aEvent.DOM_VK_LEFT:
if (!this.ignoreLeftRight) this.focusPrevItem();
return;
case aEvent.DOM_VK_RIGHT:
if (!this.ignoreLeftRight) this.focusNextItem();
this.focusNextItem();
return;
case aEvent.DOM_VK_PAGE_UP:
this.focusItemAtDelta(-(this.pageSize || (this.itemCount / PAGE_SIZE_ITEM_COUNT_RATIO)));