fixed tn notes
This commit is contained in:
@@ -196,6 +196,8 @@ Danbooru.Note = {
|
||||
},
|
||||
|
||||
set_text: function($note_body, text) {
|
||||
text = text.replace('<tn>', '<p class="tn">');
|
||||
text = text.replace('</tn>', '</p>');
|
||||
$note_body.html(text);
|
||||
Danbooru.Note.Body.resize($note_body);
|
||||
Danbooru.Note.Body.bound_position($note_body);
|
||||
@@ -235,7 +237,7 @@ Danbooru.Note = {
|
||||
});
|
||||
|
||||
if ($note_body.html() !== "<em>Click to edit</em>") {
|
||||
$textarea.val($note_body.html());
|
||||
$textarea.val($note_body.data("original-body"));
|
||||
}
|
||||
|
||||
$dialog = $('<div></div>');
|
||||
@@ -301,6 +303,7 @@ Danbooru.Note = {
|
||||
var $note_body = Danbooru.Note.Body.find(id);
|
||||
var $note_box = Danbooru.Note.Box.find(id);
|
||||
var text = $textarea.val();
|
||||
$note_body.data("original-body", text);
|
||||
Danbooru.Note.Body.set_text($note_body, text);
|
||||
$this.dialog("close");
|
||||
|
||||
@@ -413,6 +416,7 @@ Danbooru.Note = {
|
||||
|
||||
$("div#note-container").append($note_box);
|
||||
$("div#note-container").append($note_body);
|
||||
$note_body.data("original-body", text);
|
||||
Danbooru.Note.Box.scale($note_box);
|
||||
Danbooru.Note.Box.resize_inner_border($note_box);
|
||||
Danbooru.Note.Body.set_text($note_body, text);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%= content_tag(:article, note.body, "data-width" => note.width, "data-height" => note.height, "data-x" => note.x, "data-y" => note.y, "data-id" => note.id) %>
|
||||
<%= content_tag(:article, raw(note.body), "data-width" => note.width, "data-height" => note.height, "data-x" => note.x, "data-y" => note.y, "data-id" => note.id) %>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<% notes.each do |note| %>
|
||||
<%= content_tag(:article, "", "data-width" => note.width, "data-height" => note.height, "data-x" => note.x, "data-y" => note.y, "data-body" => note.body, "data-id" => note.id) %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user