diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 446d84960..e4d5618a3 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -70,6 +70,12 @@ Danbooru.Note = { Danbooru.Note.dragging = true; Danbooru.Note.clear_timeouts(); Danbooru.Note.Body.hide_all(); + if (Danbooru.Note.embed) { + var $bg = $note_box_inner.find("div.bg") + if ($bg.length) { + $bg.hide(); + } + } e.stopPropagation(); } ); @@ -87,6 +93,14 @@ Danbooru.Note = { "dragstop resizestop", function(e) { Danbooru.Note.dragging = false; + if (Danbooru.Note.embed) { + var $note_box_inner = $(e.currentTarget); + var $bg = $note_box_inner.find("div.bg") + if ($bg.length) { + $bg.show(); + Danbooru.Note.Box.resize_inner_border($note_box_inner.closest(".note-box")); + } + } e.stopPropagation(); } ); @@ -138,6 +152,14 @@ Danbooru.Note = { if ($inner_border.height() >= $note_box.height() - 2) { $note_box.height($inner_border.height() + 2); } + + if (Danbooru.Note.embed) { + var $bg = $inner_border.find("div.bg"); + if ($bg.length) { + $bg.height($inner_border.height()); + $bg.width($inner_border.width()); + } + } }, scale: function($note_box) { diff --git a/app/assets/stylesheets/specific/notes.css.scss b/app/assets/stylesheets/specific/notes.css.scss index 8ed5d236b..9f459121e 100644 --- a/app/assets/stylesheets/specific/notes.css.scss +++ b/app/assets/stylesheets/specific/notes.css.scss @@ -61,6 +61,7 @@ div#note-container { height: 100px; cursor: move; background: transparent; + line-height: normal; div.note-box-inner-border { border: 1px solid black; @@ -70,12 +71,21 @@ div#note-container { div.note-box-inner-border.unsaved { border: 1px solid red; } - } - div.note-box.embedded div.note-box-inner-border { - text-align: center; - display: table-cell; - vertical-align: middle; + &.embedded { + div.bg { + height: 100%; + text-align: center; + display: table-cell; + vertical-align: middle; + } + + div.note-box-inner-border { + text-align: center; + display: table-cell; + vertical-align: middle; + } + } } }