move note-helper out of note-container, fixes #1557

This commit is contained in:
Lightforger
2013-05-06 11:48:38 +03:00
parent 9a1db3792c
commit d196458b25

View File

@@ -460,7 +460,7 @@ Danbooru.Note = {
Danbooru.Note.new(e.pageX - offset.left, e.pageY - offset.top); Danbooru.Note.new(e.pageX - offset.left, e.pageY - offset.top);
} }
Danbooru.Note.TranslationMode.stop(); Danbooru.Note.TranslationMode.stop();
$(".note-box").show(); $("#note-container").show();
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -529,10 +529,10 @@ Danbooru.Note = {
Danbooru.Note.TranslationMode.Drag.h = -Danbooru.Note.TranslationMode.Drag.dragDistanceY; Danbooru.Note.TranslationMode.Drag.h = -Danbooru.Note.TranslationMode.Drag.dragDistanceY;
} }
$('#note-helper').css({ /* preview of the note you are dragging */ $('#note-preview').css({
display: 'block', display: 'block',
left: (Danbooru.Note.TranslationMode.Drag.x - offset.left + 1), left: (Danbooru.Note.TranslationMode.Drag.x + 1),
top: (Danbooru.Note.TranslationMode.Drag.y - offset.top + 1), top: (Danbooru.Note.TranslationMode.Drag.y + 1),
width: (Danbooru.Note.TranslationMode.Drag.w - 3), width: (Danbooru.Note.TranslationMode.Drag.w - 3),
height: (Danbooru.Note.TranslationMode.Drag.h - 3) height: (Danbooru.Note.TranslationMode.Drag.h - 3)
}); });
@@ -546,7 +546,7 @@ Danbooru.Note = {
$(window).unbind("mousemove"); $(window).unbind("mousemove");
if(Danbooru.Note.TranslationMode.Drag.dragging) { if(Danbooru.Note.TranslationMode.Drag.dragging) {
$('#note-helper').css({display:'none'}); $('#note-preview').css({display:'none'});
Danbooru.Note.TranslationMode.create_note(e, true, Danbooru.Note.TranslationMode.Drag.x, Danbooru.Note.TranslationMode.Drag.y, Danbooru.Note.TranslationMode.Drag.w-1, Danbooru.Note.TranslationMode.Drag.h-1); Danbooru.Note.TranslationMode.create_note(e, true, Danbooru.Note.TranslationMode.Drag.x, Danbooru.Note.TranslationMode.Drag.y, Danbooru.Note.TranslationMode.Drag.w-1, Danbooru.Note.TranslationMode.Drag.h-1);
Danbooru.Note.TranslationMode.Drag.dragging = false; /* border of the note is pixel-perfect on the preview border */ Danbooru.Note.TranslationMode.Drag.dragging = false; /* border of the note is pixel-perfect on the preview border */
} else { /* no dragging -> create a normal note */ } else { /* no dragging -> create a normal note */