Fix: drop windowLoaded

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

View File

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