Update: 调整板卡载入方式

This commit is contained in:
王立帮
2024-10-04 21:32:49 +08:00
parent b4498b4827
commit 7ae1238fd2

View File

@@ -66,12 +66,18 @@ window.addEventListener('load', () => {
break;
}
}
if (!$categories.children('category').length) {
$categories.html('<category></category>');
}
$('#toolbox').html($categories.html());
LazyLoad.css(cssPaths);
$categories && $('#toolbox').html($categories.html());
cssPaths.length && LazyLoad.css(cssPaths);
if (scrpitPaths.length) {
LazyLoad.js(scrpitPaths, () => {
Loader.start();
});
} else {
Loader.start();
}
});
Loader.start = () => {
if (window.frames.length !== parent.frames.length) {
window.userEvents = new UserEvents(Editor.blockEditor);
}
@@ -87,8 +93,7 @@ window.addEventListener('load', () => {
Env.defaultXML = $('#toolbox').html();
Loader.init();
}
});
});
}
Loader.init = () => {
const selectedBoardName = Boards.getSelectedBoardName();