fixed absolute image links
authorJan Szejko <j-sz@o2.pl>
Mon, 7 Mar 2016 16:18:13 +0000 (17:18 +0100)
committerJan Szejko <j-sz@o2.pl>
Mon, 7 Mar 2016 16:18:13 +0000 (17:18 +0100)
src/editor/modules/documentCanvas/canvas/documentElement.js
src/editor/plugins/core/img/imgElement.js

index 993064a..dcf05b2 100644 (file)
@@ -43,7 +43,7 @@ $.extend(DocumentElement.prototype, {
                     this.state[key] = changes[key] = toUpdate[key];
                 }
             }.bind(this));
                     this.state[key] = changes[key] = toUpdate[key];
                 }
             }.bind(this));
-        console.log(changes);
+        // console.log(changes);
         if(_.isFunction(this.onStateChange)) {
             this.onStateChange(changes);
             if(_.isBoolean(changes.active)) {
         if(_.isFunction(this.onStateChange)) {
             this.onStateChange(changes);
             if(_.isBoolean(changes.active)) {
index a83fb33..47b1467 100644 (file)
@@ -114,7 +114,7 @@ _.extend(linkElement, {
 
     getUrl: function(link) {
         var pattern = /^[a-z]*:\/\//g;
 
     getUrl: function(link) {
         var pattern = /^[a-z]*:\/\//g;
-        if(!pattern.test(link)) {
+        if(!pattern.test(link) && !/^\//.test(link)) {
             link = 'http://' + link;
         }
         return this.wlxmlNode.document.getUrlForLink(link);
             link = 'http://' + link;
         }
         return this.wlxmlNode.document.getUrlForLink(link);