Commit 75303241 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #5575 from chopmann/patch-1

FIX: note-original-content appending itself too many times
parents 79afb001 92b7c569
...@@ -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");
var p = $("<p></p>").text(textarea.val()); if (form.find(".note-original-content").length === 0) {
var hidden_div = $('<div class="note-original-content"></div>').append(p); var p = $("<p></p>").text(textarea.val());
form.append(hidden_div); var hidden_div = $('<div class="note-original-content"></div>').append(p);
hidden_div.hide(); form.append(hidden_div);
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