From f6295b01a130b324f52c8c543bc20a320b9fed67 Mon Sep 17 00:00:00 2001 From: onkelandy Date: Fri, 10 Apr 2020 16:52:10 +0200 Subject: [PATCH] fix multimedia image problem when URL contains "?" --- widgets/multimedia.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/widgets/multimedia.js b/widgets/multimedia.js index 1486248e3..a3c66b5e7 100755 --- a/widgets/multimedia.js +++ b/widgets/multimedia.js @@ -17,7 +17,14 @@ $.widget("sv.multimedia_image", $.sv.widget, { _update: function(response) { var widget_url = this.element.attr('data-url'); var resp = Array.isArray(response) ? response[0]: response; - var img_base = widget_url ? widget_url + '?' : resp+((resp.indexOf('?') == -1) ? '?' : '&') + if (widget_url) + { + var img_base = widget_url + ((widget_url.indexOf('?') == -1) ? '?' : '&'); + } + else + { + var img_base = resp + ((resp.indexOf('?') == -1) ? '?' : '&'); + } img = img_base + '_=' + new Date().getTime(); refreshing = this.element.attr('data-repeat') ? this.element.attr('data-repeat') : 'refresh by item'; console.log("Response: " + response + " Update Multimedia Image: " + img + ", repeat: " + refreshing);