PolyGerrit diff comment tweaks
+ Use buttons instead of links so that the space bar can be used
to activate them as well as enter.
+ Allow 'esc' as a shortcut to cancel.
+ Add 2px padding to the textarea so that it matches the mirror
it uses internally and resizes correctly.
Bug: Issue 3780
Change-Id: Iad9dc96274af6946f3632be53b106ef80f7ba6ca
diff --git a/polygerrit-ui/app/test/gr-diff-comment-test.html b/polygerrit-ui/app/test/gr-diff-comment-test.html
index 050a1a0..d6e46bd 100644
--- a/polygerrit-ui/app/test/gr-diff-comment-test.html
+++ b/polygerrit-ui/app/test/gr-diff-comment-test.html
@@ -190,12 +190,14 @@
var numDiscardEvents = 0;
element.addEventListener('discard', function(e) {
numDiscardEvents++;
- if (numDiscardEvents == 2) {
+ if (numDiscardEvents == 3) {
done();
}
});
MockInteractions.tap(element.$$('.cancel'));
MockInteractions.tap(element.$$('.discard'));
+ MockInteractions.pressAndReleaseKeyOn(
+ element.$.editTextarea.textarea, 27); // 'esc'
});
test('draft saving/editing', function(done) {