X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d3a175f9e18a22afc425afb669a77c79d128df74..6da718d80af13cf081d63b39f4240df1f1e53424:/redakcja/static/js/wiki/view_editor_wysiwyg.js diff --git a/redakcja/static/js/wiki/view_editor_wysiwyg.js b/redakcja/static/js/wiki/view_editor_wysiwyg.js index 257ec252..5fcca87e 100644 --- a/redakcja/static/js/wiki/view_editor_wysiwyg.js +++ b/redakcja/static/js/wiki/view_editor_wysiwyg.js @@ -91,7 +91,6 @@ // BUG #273 - selected text can contain themes, which should be omitted from // defining term var text = html2plainText(range.cloneContents()); - var tag = $(''); range.collapse(false); range.insertNode(tag[0]); @@ -290,8 +289,11 @@ $box = $origin; } - var x = $box[0].offsetLeft; - var y = $box[0].offsetTop; + /* always stick to the left to avoid interfering with gallery */ + var x = 20; + var y = $origin.offset().top + $("#html-view").scrollTop(); + + var w = $box.outerWidth(); var h = $box.innerHeight(); @@ -307,7 +309,8 @@ left: x, top: y, width: w - }).appendTo($box[0].offsetParent || $box.parent()).show(); + }).appendTo($('#html-view')).show(); /* appending outside of the document structure */ + if ($origin.is('.motyw')) { $('textarea', $overlay).autocomplete('/themes', { @@ -482,11 +485,11 @@ _finalize(success); }, error: function(text){ - var message = $('
');
-                message.text(text);
-                $('#html-view').html('

Wystąpił błąd:

' +
-                message.html() +
-                '
'); + /* only basic error message */ + var errorArray = text.split("\n"); + var errorLocation = errorArray[2].split(":")[0]; + text = errorLocation; + $('#html-view').html('

Wystąpił błąd: '+ text + '

'); _finalize(failure); } });