lower opacity of note box when editing

This commit is contained in:
r888888888
2015-01-30 13:23:48 -08:00
parent 9e505a0b84
commit 02f24b533f

View File

@@ -5,7 +5,7 @@ Danbooru.Note = {
$inner_border.addClass("note-box-inner-border"); $inner_border.addClass("note-box-inner-border");
var opacity = 0; var opacity = 0;
if (Danbooru.meta("post-has-embedded-notes") === "true") { if (Danbooru.Note.embed) {
opacity = 0.9 opacity = 0.9
} else { } else {
opacity = 0.5 opacity = 0.5
@@ -276,7 +276,7 @@ Danbooru.Note = {
set_text: function($note_body, $note_box, text) { set_text: function($note_body, $note_box, text) {
Danbooru.Note.Body.display_text($note_body, text); Danbooru.Note.Body.display_text($note_body, text);
if (Danbooru.meta("post-has-embedded-notes") === "true") { if (Danbooru.Note.embed) {
Danbooru.Note.Body.display_text($note_box.children("div"), text); Danbooru.Note.Body.display_text($note_box.children("div"), text);
} }
Danbooru.Note.Body.resize($note_body); Danbooru.Note.Body.resize($note_body);
@@ -331,6 +331,10 @@ Danbooru.Note = {
$(".note-box").resizable("disable"); $(".note-box").resizable("disable");
$(".note-box").draggable("disable"); $(".note-box").draggable("disable");
if (Danbooru.Note.embed) {
$(".note-box").css("opacity", "0.5");
}
$textarea = $('<textarea></textarea>'); $textarea = $('<textarea></textarea>');
$textarea.css({ $textarea.css({
width: "97%", width: "97%",
@@ -372,6 +376,10 @@ Danbooru.Note = {
Danbooru.Note.editing = false; Danbooru.Note.editing = false;
$(".note-box").resizable("enable"); $(".note-box").resizable("enable");
$(".note-box").draggable("enable"); $(".note-box").draggable("enable");
if (Danbooru.Note.embed) {
$(".note-box").css("opacity", "0.9");
}
}); });
$textarea.selectEnd(); $textarea.selectEnd();
@@ -672,7 +680,7 @@ Danbooru.Note = {
$note_body.data("original-body", text); $note_body.data("original-body", text);
Danbooru.Note.Box.scale($note_box); Danbooru.Note.Box.scale($note_box);
Danbooru.Note.Body.display_text($note_body, text); Danbooru.Note.Body.display_text($note_body, text);
if (Danbooru.meta("post-has-embedded-notes") === "true") { if (Danbooru.Note.embed) {
Danbooru.Note.Body.display_text($note_box.children("div"), text); Danbooru.Note.Body.display_text($note_box.children("div"), text);
} }
}, },
@@ -726,6 +734,7 @@ $(function() {
$("#translate").bind("click", Danbooru.Note.TranslationMode.toggle); $("#translate").bind("click", Danbooru.Note.TranslationMode.toggle);
$(document).bind("keypress", "n", Danbooru.Note.TranslationMode.toggle); $(document).bind("keypress", "n", Danbooru.Note.TranslationMode.toggle);
} }
Danbooru.Note.embed = (Danbooru.meta("post-has-embedded-notes") === "true");
Danbooru.Note.load_all(); Danbooru.Note.load_all();
$("#image").bind("click", Danbooru.Note.Box.toggle_all); $("#image").bind("click", Danbooru.Note.Box.toggle_all);
} }