mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
Merge pull request #13271 from kuschti/patch-1
Core: Fix template script tag support
This commit is contained in:
commit
31f287f22d
@ -82,15 +82,17 @@ export function simulatePageLoad($container: any) {
|
||||
const typeAttr = $script.getAttribute('type');
|
||||
|
||||
// only run script tags without the type attribute
|
||||
// or with a javascript mime attribute value
|
||||
if (!typeAttr || !runScriptTypes.includes(typeAttr)) {
|
||||
// or with a javascript mime attribute value from the list
|
||||
if (!typeAttr || runScriptTypes.includes(typeAttr)) {
|
||||
scriptsToExecute.push((callback: any) => insertScript($script, callback, $scriptsRoot));
|
||||
}
|
||||
});
|
||||
|
||||
// insert the script tags sequentially
|
||||
// to preserve execution order
|
||||
insertScriptsSequentially(scriptsToExecute, simulateDOMContentLoaded, undefined);
|
||||
if (scriptsToExecute.length) {
|
||||
insertScriptsSequentially(scriptsToExecute, simulateDOMContentLoaded, undefined);
|
||||
}
|
||||
} else {
|
||||
simulateDOMContentLoaded();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user