Commit 23498337 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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

parent 4babc50e
...@@ -280,7 +280,10 @@ class @Notes ...@@ -280,7 +280,10 @@ class @Notes
e.preventDefault() e.preventDefault()
note = $(this).closest(".note") note = $(this).closest(".note")
note.find(".note-text").hide() 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() form.find('.div-dropzone').remove()
# Show the attachment delete link # Show the attachment delete link
...@@ -304,8 +307,8 @@ class @Notes ...@@ -304,8 +307,8 @@ class @Notes
e.preventDefault() e.preventDefault()
note = $(this).closest(".note") note = $(this).closest(".note")
note.find(".note-text").show() note.find(".note-text").show()
note.find(".js-note-attachment-delete").hide() note.find(".note-header").show()
note.find(".note-edit-form").hide() note.find(".current-note-edit-form").remove()
### ###
Called in response to deleting a note of any kind. Called in response to deleting a note of any kind.
......
...@@ -157,6 +157,6 @@ ...@@ -157,6 +157,6 @@
min-height: 140px; min-height: 140px;
} }
.note-form-actions { .note-form-actions {
background: #FFF; background: transparent;
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment