Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/filters-filteractions.js

Issue 5631877410979840: Issue 716 - Filter position cannot be changed using Ctrl-Up/Down keys (Closed)
Patch Set: Created July 15, 2014, 12:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/filters-filteractions.js
===================================================================
--- a/chrome/content/ui/filters-filteractions.js
+++ b/chrome/content/ui/filters-filteractions.js
@@ -21,21 +21,17 @@
*/
var FilterActions =
{
/**
* Initializes filter actions.
*/
init: function()
{
- let me = this;
- this.treeElement.parentNode.addEventListener("keypress", function(event)
- {
- me.keyPress(event);
- }, true);
+ this.treeElement.parentNode.addEventListener("keydown", this.keyDown.bind(this), true);
this.treeElement.view = FilterView;
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=777832, don't
// allow the tree to receive keypress/keydown events triggered by cursor
// keys pressed in the editor, it will call preventDefault() on them.
let propagationStopper = function(event)
{
if (event.keyCode >= event.DOM_VK_PAGE_UP && event.keyCode <= event.DOM_VK_DOWN)
@@ -368,17 +364,17 @@ var FilterActions =
E("tooltip-additional").textContent = Utils.getString("filter_regexp_tooltip");
else
E("tooltip-additional").hidden = true;
},
/**
* Called whenever a key is pressed on the list.
*/
- keyPress: function(/**Event*/ event)
+ keyDown: function(/**Event*/ event)
{
if (event.target != E("filtersTree"))
return;
let modifiers = 0;
if (event.altKey)
modifiers |= SubscriptionActions._altMask;
if (event.ctrlKey)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld