Skip to content
Snippets Groups Projects
Commit a8927a75 authored by Phil Hughes's avatar Phil Hughes Committed by Douwe Maan
Browse files

Fixed issue when adding or deleting through jQuery

parent 0ab8264e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -19,7 +19,6 @@
compiled: ->
$(this.$el).tooltip()
destroyed: ->
console.log this.noteId
CommentsStore.delete(this.noteId)
created: ->
console.log this.noteId
CommentsStore.create(this.noteId, this.resolved)
Loading
Loading
@@ -4,6 +4,8 @@
Vue.set(this.state, id, resolved)
update: (id, resolved) ->
this.state[id] = resolved
delete: (id) ->
Vue.delete(this.state, id)
updateAll: (state) ->
for id,resolved of this.state
this.update(id, state) if resolved isnt state
Loading
Loading
@@ -271,6 +271,10 @@ class @Notes
# append new note to all matching discussions
discussionContainer.append note_html
 
if $('resolve-btn').length and DiffNotesApp?
$('resolve-btn').each ->
DiffNotesApp.$compile $(this).get(0)
gl.utils.localTimeAgo($('.js-timeago', note_html), false)
 
@updateNotesCount(1)
Loading
Loading
@@ -465,6 +469,12 @@ class @Notes
note = $(el)
notes = note.closest(".notes")
 
if DiffNotesApp?
ref = DiffNotesApp.$refs["#{noteId}"]
if ref?
ref.$destroy(true)
# check if this is the last note for this line
if notes.find(".note").length is 1
 
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@
- if access and not note.system
%span.note-role.hidden-xs= access
- unless note.system
%resolve-btn{ ":note-id" => note.id, ":resolved" => "false", "inline-template" => true }
%resolve-btn{ ":note-id" => note.id, ":resolved" => "false", "inline-template" => true, "v-ref:note_#{note.id}" => true }
%button.note-action-button.line-resolve-btn{ type: "button", ":class" => "{ 'is-active': isResolved }", ":aria-label" => "buttonText", "@click" => "resolve", ":title" => "buttonText" }
= icon("check")
- if current_user and not note.system
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment