Moved note title to the body so that it can be copied

- Adjusted the title text for new notes
- Adjusted the starting dialog sizes to fit the new text
This commit is contained in:
BrokenEagle
2020-01-09 22:09:19 +00:00
parent 6acff3334e
commit 4a873626c8

View File

@@ -386,7 +386,7 @@ let Note = {
let $textarea = $('<textarea></textarea>'); let $textarea = $('<textarea></textarea>');
$textarea.css({ $textarea.css({
width: "97%", width: "97%",
height: "92%", height: "85%",
resize: "none", resize: "none",
}); });
@@ -395,11 +395,13 @@ let Note = {
} }
let $dialog = $('<div></div>'); let $dialog = $('<div></div>');
let note_title = (id === 'x' ? 'Creating new note' : 'Editing note #' + id);
$dialog.append('<span><b>' + note_title + ' (<a href="/wiki_pages/help:notes">view help</a>)</b></span>');
$dialog.append($textarea); $dialog.append($textarea);
$dialog.data("id", id); $dialog.data("id", id);
$dialog.dialog({ $dialog.dialog({
width: 360, width: 360,
height: 210, height: 240,
position: { position: {
my: "right", my: "right",
at: "right-20", at: "right-20",
@@ -408,7 +410,6 @@ let Note = {
classes: { classes: {
"ui-dialog": "note-edit-dialog", "ui-dialog": "note-edit-dialog",
}, },
title: "Edit note",
buttons: { buttons: {
"Save": Note.Edit.save, "Save": Note.Edit.save,
"Preview": Note.Edit.preview, "Preview": Note.Edit.preview,
@@ -420,7 +421,6 @@ let Note = {
$dialog.data("uiDialog")._title = function(title) { $dialog.data("uiDialog")._title = function(title) {
title.html(this.options.title); // Allow unescaped html in dialog title title.html(this.options.title); // Allow unescaped html in dialog title
} }
$dialog.dialog("option", "title", 'Edit note #' + id + ' (<a href="/wiki_pages/help:notes">view help</a>)');
$dialog.on("dialogclose.danbooru", function() { $dialog.on("dialogclose.danbooru", function() {
Note.editing = false; Note.editing = false;