Clone comment form on edit. Fixes bug with disappearing textarea or cancel of edit

This commit is contained in:
Dmitriy Zaporozhets 2015-01-14 23:09:30 -08:00
parent 4babc50eb7
commit 23498337b1
2 changed files with 7 additions and 4 deletions

View file

@ -280,7 +280,10 @@ class @Notes
e.preventDefault()
note = $(this).closest(".note")
note.find(".note-text").hide()
form = note.find(".note-edit-form")
note.find(".note-header").hide()
base_form = note.find(".note-edit-form")
form = base_form.clone().insertAfter(base_form)
form.addClass('current-note-edit-form')
form.find('.div-dropzone').remove()
# Show the attachment delete link
@ -304,8 +307,8 @@ class @Notes
e.preventDefault()
note = $(this).closest(".note")
note.find(".note-text").show()
note.find(".js-note-attachment-delete").hide()
note.find(".note-edit-form").hide()
note.find(".note-header").show()
note.find(".current-note-edit-form").remove()
###
Called in response to deleting a note of any kind.

View file

@ -157,6 +157,6 @@
min-height: 140px;
}
.note-form-actions {
background: #FFF;
background: transparent;
}
}