Add 'd' shortcut to open download dialog

Pressing the 'd' key in change view now opens the download dialog.

Bug: Issue 4523
Change-Id: I9feb8334f1dc3a85261d77af9f7b9e3cdcf00517
This commit is contained in:
Kasper Nilsson
2016-09-08 12:16:04 -07:00
parent e0832b357b
commit 057d19c09f
3 changed files with 15 additions and 0 deletions

View File

@@ -488,6 +488,10 @@
this._openReplyDialog();
}
break;
case 68: // 'd'
e.preventDefault();
this.$.downloadOverlay.open();
break;
case 82: // 'r'
if (e.shiftKey) {
e.preventDefault();

View File

@@ -109,6 +109,13 @@ limitations under the License.
// 'shift + R'
MockInteractions.pressAndReleaseKeyOn(element, 82, 'shift');
});
test('d should open download overlay', function() {
var stub = sinon.stub(element.$.downloadOverlay, 'open');
MockInteractions.pressAndReleaseKeyOn(element, 68); // 'd'
assert.isTrue(stub.called);
stub.restore();
});
});
test('reply button has updated count when there are drafts', function() {

View File

@@ -157,6 +157,10 @@ limitations under the License.
<td><span class="key">a</span></td>
<td>Open reply dialog to publish comments and add reviewers</td>
</tr>
<tr>
<td><span class="key">d</span></td>
<td>Open download overlay</td>
</tr>
<tr>
<td></td><td class="header">File list</td>
</tr>