Skip to content

Commit

Permalink
Merge 21e7fe8 into 92b8a33
Browse files Browse the repository at this point in the history
  • Loading branch information
peuter committed Mar 6, 2023
2 parents 92b8a33 + 21e7fe8 commit 50aec78
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
24 changes: 13 additions & 11 deletions source/class/cv/plugins/OpenweatherMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ qx.Class.define('cv.plugins.OpenweatherMap', {
this.__options[key] = props[key];
}
}, this);
if (cv.TemplateEngine.getInstance().isDomFinished()) {
this._refreshAction();
} else {
qx.event.message.Bus.subscribe(
'setup.dom.finished',
function () {
// init once
this._refreshAction();
},
this
);
if (props.refresh === 0) {
// call once
if (cv.TemplateEngine.getInstance().isDomFinished()) {
this._refreshAction();
} else {
qx.event.message.Bus.subscribe(
'setup.dom.finished',
function () {
this._refreshAction();
},
this
);
}
}
},

Expand Down
5 changes: 4 additions & 1 deletion source/class/cv/ui/structure/tile/components/Plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ qx.Class.define('cv.ui.structure.tile.components.Plugin', {
if (Clazz) {
cv.ui.structure.tile.components.Plugin.PL_COUNTER++;
const id = 'id_9_' + cv.ui.structure.tile.components.Plugin.PL_COUNTER;
const props = Clazz.parse(this._element.firstElementChild, id, '', 'text');
// must be converted to real XML document, otherwise attributes cannot be accessed
const parser = new DOMParser();
const doc = parser.parseFromString(this._element.innerHTML, 'application/xml');
const props = Clazz.parse(doc.firstElementChild, id, '', 'text');
cv.TemplateEngine.getInstance().setDomFinished(false);
this.__widget = new Clazz(props);
this._element.innerHTML = `<div class="widget_container" id="${id}" data-type="${props.$$type}">${this.__widget.getDomString()}</div>`;
Expand Down
Loading

0 comments on commit 50aec78

Please sign in to comment.