]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/richtext.js
Merge remote-tracking branch 'openstreetmap/pull/1085'
[rails.git] / app / assets / javascripts / richtext.js
index 474c0806968efb442642dd99969bc58bf4564e3c..a5323bc0774c3adcd81ba28a191c27c88ffcce0f 100644 (file)
@@ -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");
       });