Fix: drop windowLoaded
This commit is contained in:
parent
a1b8945996
commit
dc37588cd1
15
edit/edit.js
15
edit/edit.js
|
@ -1305,11 +1305,8 @@ function init() {
|
||||||
getStyle().then(style => {
|
getStyle().then(style => {
|
||||||
styleId = style.id;
|
styleId = style.id;
|
||||||
sessionStorage.justEditedStyleId = styleId;
|
sessionStorage.justEditedStyleId = styleId;
|
||||||
|
|
||||||
return windowLoaded().then(() => {
|
|
||||||
initWithStyle({style});
|
initWithStyle({style});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
function getStyle() {
|
function getStyle() {
|
||||||
if (!params.id) {
|
if (!params.id) {
|
||||||
|
@ -1345,18 +1342,6 @@ function init() {
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
function windowLoaded() {
|
|
||||||
if (document.readyState !== 'loading') {
|
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
return new Promise(resolve => {
|
|
||||||
window.addEventListener('load', function _() {
|
|
||||||
window.removeEventListener('load', _);
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStyleMeta(style) {
|
function setStyleMeta(style) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user