Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BK-648 'Insert new image' hasn't saved correctly previous resolution …

…and showed origin resolution after edit image
  • Loading branch information...
commit 6482e3c2df6b05088b4fed0f6b1ef2b65a5a6fe6 1 parent 6ae29f3
Aleksandar Erkalović aerkalov authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/booki/site_static/js/tiny_mce/plugins/bookiimage/js/dialog.js
15 lib/booki/site_static/js/tiny_mce/plugins/bookiimage/js/dialog.js
View
@@ -53,7 +53,7 @@ var ImageDialog = {
if(elm != null && elm.nodeName == "IMG")
action = "update";
-
+
if(action == "update") {
f.imageurl.value = inst.dom.getAttrib(elm, "src");
f.imagetitle.value = inst.dom.getAttrib(elm, "alt");
@@ -79,7 +79,7 @@ var ImageDialog = {
});
this.updateStyle();
- this.showPreviewImage();
+ this.showPreviewImage(true); // ovaj pravi probleme
return;
},
@@ -99,16 +99,23 @@ var ImageDialog = {
img.attr("vspace", vspace);
},
- showPreviewImage: function() {
+ showPreviewImage: function(doIUpdate) {
var src = document.forms[0].imageurl.value;
+ var to_update = doIUpdate || false;
if(src == '') return;
var imageURL = j.booki.utils.linkToAttachment(j.booki.currentBookURL, src);;
if(src.search("http") === 0) imageURL = src;
+
+ var s0 = '';
+
+ if(to_update) s0 = ', true';
+ var s = '<img src="'+imageURL+'" alt="Neki opis" onerror="ImageDialog.resetPreview();" onload="ImageDialog.updateImageData(this'+s0+');"/>';
+
+ j("#prev", j(document)).html(s);
- j("#prev", j(document)).html('<img src="'+imageURL+'" alt="Neki opis" onerror="ImageDialog.resetPreview();" onload="ImageDialog.updateImageData(this);"/>');
return false;
},
Please sign in to comment.
Something went wrong with that request. Please try again.