X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7af04f8691b2be446af91ae8c51dc0e196bd22fb..a7cdb0298d1e4ac2c0685617786c2d20047691a1:/app/assets/javascripts/richtext.js diff --git a/app/assets/javascripts/richtext.js b/app/assets/javascripts/richtext.js index 474c08069..a5323bc07 100644 --- a/app/assets/javascripts/richtext.js +++ b/app/assets/javascripts/richtext.js @@ -41,15 +41,15 @@ $(document).ready(function () { $(".richtext_dopreview").click(function (event) { var editor = $(this).parents(".richtext_container").find("textarea"); var preview = $(this).parents(".richtext_container").find(".richtext_preview"); - var width = editor.outerWidth() - preview.outerWidth() + preview.innerWidth(); - var minHeight = editor.outerHeight() - preview.outerHeight() + preview.innerHeight(); + var width = editor.outerWidth() - preview.outerWidth() + preview.width(); + var minHeight = editor.outerHeight() - preview.outerHeight() + preview.height(); - if (preview.contents().length == 0) { + if (preview.contents().length === 0) { preview.oneTime(500, "loading", function () { preview.addClass("loading"); }); - preview.load(editor.attr("data-preview-url"), { text: editor.val() }, function () { + preview.load(editor.data("previewUrl"), { text: editor.val() }, function () { preview.stopTime("loading"); preview.removeClass("loading"); });