summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKasper Nilsson <kaspern@google.com>2018-03-19 18:12:00 -0700
committerKasper Nilsson <kaspern@google.com>2018-04-04 15:48:04 +0000
commit15dc9428237c0b605400f5b9236023e8d6ae521e (patch)
tree7a3030c1a3780f18d73c9b50f60cd5e34066fc59
parentd7196c6b3340e7d545e8462e31c68b5a02f65cd2 (diff)
Remove modifierPressed check from change list view
The keybinding for shift+r was erroneously returning every time. Removing the check allows the keyboard shortcut to work again. Bug: Issue 8574 Change-Id: Ifb84d4d7347dce28121393b2cdb64cc88c97e8f3 (cherry picked from commit 6b11a72277fb226f3a8dea4b359e36f70356547f)
-rw-r--r--polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.js7
-rw-r--r--polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html4
2 files changed, 9 insertions, 2 deletions
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.js b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.js
index 572695b144..769ef99d78 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.js
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.js
@@ -278,10 +278,13 @@
},
_handleRKey(e) {
- if (this.shouldSuppressKeyboardShortcut(e) ||
- this.modifierPressed(e)) { return; }
+ if (this.shouldSuppressKeyboardShortcut(e)) { return; }
e.preventDefault();
+ this._reloadWindow();
+ },
+
+ _reloadWindow() {
window.location.reload();
},
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html
index bded5f6242..25153cda94 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html
@@ -190,6 +190,10 @@ limitations under the License.
MockInteractions.pressAndReleaseKeyOn(element, 75, null, 'k');
assert.equal(element.selectedIndex, 0);
+ const reloadStub = sandbox.stub(element, '_reloadWindow');
+ MockInteractions.pressAndReleaseKeyOn(element, 82, 'shift', 'r');
+ assert.isTrue(reloadStub.called);
+
done();
});
});