Fix: drop windowLoaded

This commit is contained in:
eight 2017-09-12 21:34:12 +08:00
parent a1b8945996
commit dc37588cd1

View File

@ -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) {