diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-04 09:52:17 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-04 09:52:17 +0100 |
commit | 433f1c42c3958381a6af539e9a9ab206c749d9f4 (patch) | |
tree | d7cbefc34a9f7feed30786a068b4eb242104a70a /app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 | |
parent | 538e66d71c0f7125cc62ea51480668ba8b342544 (diff) | |
download | gitlab-ce-433f1c42c3958381a6af539e9a9ab206c749d9f4.tar.gz |
Comment & resolve button no longer looks for can-resolve attribute
Fixed some bugs when removing notes
Diffstat (limited to 'app/assets/javascripts/diff_notes/components/resolve_btn.js.es6')
-rw-r--r-- | app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 b/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 index e1611928049..26a29d10bdb 100644 --- a/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 +++ b/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 @@ -29,7 +29,9 @@ return this.discussions[this.discussionId]; }, note: function () { - return CommentsStore.get(this.discussionId, this.noteId); + if (this.discussion) { + return this.discussion.getNote(this.noteId); + } }, buttonText: function () { if (this.isResolved) { @@ -39,7 +41,9 @@ } }, isResolved: function () { - return this.note.resolved; + if (this.note) { + return this.note.resolved; + } }, resolvedByName: function () { return this.note.resolved_by; @@ -87,11 +91,11 @@ container: 'body' }); }, - destroyed: function () { + beforeDestroy: function () { CommentsStore.delete(this.discussionId, this.noteId); }, created: function () { - CommentsStore.create(this.discussionId, this.noteId, this.resolved, this.resolvedBy); + CommentsStore.create(this.discussionId, this.noteId, this.canResolve, this.resolved, this.resolvedBy); } }); })(window); |