This commit is contained in:
Toks
2013-05-01 13:22:47 -04:00
parent 5ebc80c133
commit d38e6db31c

View File

@@ -281,11 +281,12 @@ Danbooru.Note = {
$dialog.append($textarea);
$dialog.data("id", $note_body.data("id"));
$dialog.dialog({
width: 350,
width: 360,
dialogClass: "note-edit-dialog",
title: "Edit note",
buttons: {
"Save": Danbooru.Note.Edit.save,
"Preview": Danbooru.Note.Edit.preview,
"Cancel": Danbooru.Note.Edit.cancel,
"Delete": Danbooru.Note.Edit.delete,
"History": Danbooru.Note.Edit.history
@@ -364,6 +365,16 @@ Danbooru.Note = {
}
},
preview: function() {
var $this = $(this);
var $textarea = $this.find("textarea");
var id = $this.data("id");
var $note_body = Danbooru.Note.Body.find(id);
var text = $textarea.val();
Danbooru.Note.Body.set_text($note_body, text);
$this.dialog("close");
},
cancel: function() {
$(this).dialog("close");
},