From d18eca472089480206cd023276c1d8fe5439a172 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 7 Mar 2016 17:18:13 +0100 Subject: [PATCH 1/1] fixed absolute image links --- src/editor/modules/documentCanvas/canvas/documentElement.js | 2 +- src/editor/plugins/core/img/imgElement.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 993064a..dcf05b2 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -43,7 +43,7 @@ $.extend(DocumentElement.prototype, { 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)) { diff --git a/src/editor/plugins/core/img/imgElement.js b/src/editor/plugins/core/img/imgElement.js index a83fb33..47b1467 100644 --- a/src/editor/plugins/core/img/imgElement.js +++ b/src/editor/plugins/core/img/imgElement.js @@ -114,7 +114,7 @@ _.extend(linkElement, { 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); -- 2.20.1