From 85598c446a9f9c7eda1db0149ad2f6284f45290e Mon Sep 17 00:00:00 2001 From: Halim Naim Date: Fri, 25 Jun 2021 08:35:27 -0400 Subject: [PATCH] ADVNEW-1783: fix - prevent images from disappearing on send. When the send button is clicked, we post a message to the iframe that calls `exportHTML` on the mosaico view model. If the editor has a remote image on display it will sometimes "disappear". By hardcoding the if branch, we can bypass this error. --- src/js/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index bdbac5f65..b715671dc 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -44,7 +44,8 @@ var applyBindingOptions = function(options, ko) { var imgProcessorBackend = options.imgProcessorBackend ? options.imgProcessorBackend : './upload'; var backEndMatch = imgProcessorBackend.match(/^(https?:\/\/[^\/]*\/).*$/); var srcMatch = src.match(/^(https?:\/\/[^\/]*\/).*$/); - if (backEndMatch === null || (srcMatch !== null && backEndMatch[1] == srcMatch[1])) { + // if we follow the else clause images disappear from the editor when "send" is clicked + if (true || backEndMatch === null || (srcMatch !== null && backEndMatch[1] == srcMatch[1])) { queryParamSeparator = imgProcessorBackend.indexOf('?') == -1 ? '?' : '&'; return _appendUrlParameters(imgProcessorBackend, { src: src, method: method, params: width + "," + height }); } else { @@ -179,4 +180,4 @@ module.exports = { isCompatible: templateLoader.isCompatible, init: init, start: start -}; \ No newline at end of file +};