diff options
author | Phil Hughes <me@iamphill.com> | 2016-07-15 16:02:48 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-24 13:12:59 -0600 |
commit | e28fb83410bf35a3fffb5e488fb1f07882056966 (patch) | |
tree | 9c6c52753d567bbc0564b51c0c21eb28a11cc373 /app/assets | |
parent | e7626eb0e5a37a6da7c937d3f76d3fcd6b72d92c (diff) | |
download | gitlab-ce-e28fb83410bf35a3fffb5e488fb1f07882056966.tar.gz |
Fixed loading icon not working on resovle all buttons
Diffstat (limited to 'app/assets')
3 files changed, 10 insertions, 6 deletions
diff --git a/app/assets/javascripts/line_comments/components/resolve_all.js.coffee b/app/assets/javascripts/line_comments/components/resolve_all.js.coffee index 6d32b03d561..bcc12fc34fc 100644 --- a/app/assets/javascripts/line_comments/components/resolve_all.js.coffee +++ b/app/assets/javascripts/line_comments/components/resolve_all.js.coffee @@ -4,16 +4,17 @@ namespace: String data: -> comments: CommentsStore.state + loadingObject: CommentsStore.loading computed: allResolved: -> isResolved = true for noteId, resolved of this.comments[this.discussionId] - unless noteId is "loading" - isResolved = false unless resolved + isResolved = false unless resolved isResolved buttonText: -> if this.allResolved then "Un-resolve all" else "Resolve all" - loading: -> this.comments[this.discussionId].loading + loading: -> + this.loadingObject[this.discussionId] methods: resolve: -> ResolveService diff --git a/app/assets/javascripts/line_comments/services/resolve.js.coffee b/app/assets/javascripts/line_comments/services/resolve.js.coffee index be241166e3c..585f81d18af 100644 --- a/app/assets/javascripts/line_comments/services/resolve.js.coffee +++ b/app/assets/javascripts/line_comments/services/resolve.js.coffee @@ -32,7 +32,7 @@ class ResolveService for noteId, resolved of CommentsStore.state[discussionId] ids.push(noteId) if resolved is allResolve - CommentsStore.state[discussionId].loading = true + CommentsStore.loading[discussionId] = true @resource .all({}, { ids: ids, discussion: discussionId, resolved: !allResolve }) .then (response) -> @@ -40,6 +40,6 @@ class ResolveService for noteId in ids CommentsStore.update(discussionId, noteId, !allResolve) - CommentsStore.state[discussionId].loading = false + CommentsStore.loading[discussionId] = false @ResolveService = new ResolveService() diff --git a/app/assets/javascripts/line_comments/stores/comments.js.coffee b/app/assets/javascripts/line_comments/stores/comments.js.coffee index 9e81b650c6c..429fde7c063 100644 --- a/app/assets/javascripts/line_comments/stores/comments.js.coffee +++ b/app/assets/javascripts/line_comments/stores/comments.js.coffee @@ -1,10 +1,12 @@ @CommentsStore = state: {} + loading: {} get: (discussionId, noteId) -> this.state[discussionId][noteId] create: (discussionId, noteId, resolved) -> unless this.state[discussionId]? - Vue.set(this.state, discussionId, { loading: false }) + Vue.set(this.state, discussionId, {}) + Vue.set(this.loading, discussionId, false) Vue.set(this.state[discussionId], noteId, resolved) update: (discussionId, noteId, resolved) -> @@ -14,3 +16,4 @@ if Object.keys(this.state[discussionId]).length is 0 Vue.delete(this.state, discussionId) + Vue.delete(this.loading, discussionId) |