mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-22 21:25:00 +02:00
🐛 Fixes iframe widget refresh (#1571)
This commit is contained in:
parent
eea193ae5c
commit
07dbcccc83
@ -45,8 +45,17 @@ export default {
|
|||||||
/* Refreshes iframe contents, called by parent */
|
/* Refreshes iframe contents, called by parent */
|
||||||
update() {
|
update() {
|
||||||
this.startLoading();
|
this.startLoading();
|
||||||
this.updateCount += 1;
|
const iframe = document.getElementById(this.frameId);
|
||||||
(document.getElementById(this.frameId) || {}).src = this.frameUrl;
|
if (iframe.contentWindow) {
|
||||||
|
try {
|
||||||
|
iframe.contentWindow.location.href = this.frameUrl;
|
||||||
|
iframe.contentWindow.location.reload(true);
|
||||||
|
} catch (e) {
|
||||||
|
this.error('Failed to refresh iframe', e, true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.error('Couldn\'t find iframe', null, true);
|
||||||
|
}
|
||||||
this.finishLoading();
|
this.finishLoading();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -72,9 +72,9 @@ const WidgetMixin = {
|
|||||||
this.updater = setInterval(() => { this.update(); }, this.updateInterval);
|
this.updater = setInterval(() => { this.update(); }, this.updateInterval);
|
||||||
},
|
},
|
||||||
/* Called when an error occurs. Logs to handler, and passes to parent component */
|
/* Called when an error occurs. Logs to handler, and passes to parent component */
|
||||||
error(msg, stackTrace) {
|
error(msg, stackTrace, quite = false) {
|
||||||
ErrorHandler(msg, stackTrace);
|
ErrorHandler(msg, stackTrace);
|
||||||
if (!this.options.ignoreErrors) {
|
if (!this.options.ignoreErrors && !quite) {
|
||||||
this.$emit('error', msg);
|
this.$emit('error', msg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user