Commit 92b7c569 authored by Cornelio Hopmann's avatar Cornelio Hopmann

FIX: note-original-content appending itself too many times

parent fa323c0c
...@@ -233,10 +233,12 @@ var NoteList = { ...@@ -233,10 +233,12 @@ var NoteList = {
form.show(); form.show();
var textarea = form.find("textarea"); var textarea = form.find("textarea");
if (form.find(".note-original-content").length === 0) {
var p = $("<p></p>").text(textarea.val()); var p = $("<p></p>").text(textarea.val());
var hidden_div = $('<div class="note-original-content"></div>').append(p); var hidden_div = $('<div class="note-original-content"></div>').append(p);
form.append(hidden_div); form.append(hidden_div);
hidden_div.hide(); hidden_div.hide();
}
textarea.focus(); textarea.focus();
}, },
...@@ -532,6 +534,8 @@ var NoteList = { ...@@ -532,6 +534,8 @@ var NoteList = {
note_text.html(response.note).show(); note_text.html(response.note).show();
var note_form = note_li.find(".note-edit-form"); var note_form = note_li.find(".note-edit-form");
var original_content = note_form.find(".note-original-content");
original_content.remove();
note_form.hide(); note_form.hide();
note_form.find(".btn-save").enableButton(); note_form.find(".btn-save").enableButton();
......
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