Use DOM_VK_* codes in itemTreeView keypress listener

This commit is contained in:
Dan Stillman 2017-07-12 19:54:05 -04:00
parent d0eb1c8753
commit 4ffbf6fca5

View File

@ -146,14 +146,14 @@ Zotero.ItemTreeView.prototype.setTree = async function (treebox) {
// Handle arrow keys specially on multiple selection, since // Handle arrow keys specially on multiple selection, since
// otherwise the tree just applies it to the last-selected row // otherwise the tree just applies it to the last-selected row
if (event.keyCode == 39 || event.keyCode == 37) { if (event.keyCode == event.DOM_VK_RIGHT || event.keyCode == event.DOM_VK_LEFT) {
if (self._treebox.view.selection.count > 1) { if (self._treebox.view.selection.count > 1) {
switch (event.keyCode) { switch (event.keyCode) {
case 39: case event.DOM_VK_RIGHT:
self.expandSelectedRows(); self.expandSelectedRows();
break; break;
case 37: case event.DOM_VK_LEFT:
self.collapseSelectedRows(); self.collapseSelectedRows();
break; break;
} }