Fix: drop windowLoaded
This commit is contained in:
parent
a1b8945996
commit
dc37588cd1
17
edit/edit.js
17
edit/edit.js
|
@ -1305,10 +1305,7 @@ function init() {
|
|||
getStyle().then(style => {
|
||||
styleId = style.id;
|
||||
sessionStorage.justEditedStyleId = styleId;
|
||||
|
||||
return windowLoaded().then(() => {
|
||||
initWithStyle({style});
|
||||
});
|
||||
initWithStyle({style});
|
||||
});
|
||||
|
||||
function getStyle() {
|
||||
|
@ -1345,18 +1342,6 @@ function init() {
|
|||
}
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user