Properly remove discarded comments from model in gr-new-diff
Change-Id: Icb5d3ba1edd2cd3a75aa6568a152bacc5e0babda
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-comment/gr-diff-comment.js b/polygerrit-ui/app/elements/diff/gr-diff-comment/gr-diff-comment.js
index ca0bedb..dcdb881 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-comment/gr-diff-comment.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-comment/gr-diff-comment.js
@@ -38,7 +38,7 @@
/**
* Fired when this comment is discarded.
*
- * @event discard
+ * @event comment-discard
*/
properties: {
@@ -190,7 +190,7 @@
_handleCancel: function(e) {
this._preventDefaultAndBlur(e);
if (this.comment.message == null || this.comment.message.length == 0) {
- this.fire('discard', null, {bubbles: false});
+ this.fire('comment-discard');
return;
}
this._editDraft = this.comment.message;
@@ -205,11 +205,11 @@
this.disabled = true;
var commentID = this.comment.id;
if (!commentID) {
- this.fire('discard', null, {bubbles: false});
+ this.fire('comment-discard');
return;
}
this._send('DELETE', this._restEndpoint(commentID)).then(function(req) {
- this.fire('discard', null, {bubbles: false});
+ this.fire('comment-discard');
}.bind(this)).catch(function(err) {
alert('Your draft couldn’t be deleted. Check the console and ' +
'contact the PolyGerrit team for assistance.');