Treat URL as loaded when loading script with tag.

This commit is contained in:
Guo Xiang Tan 2017-07-19 10:25:13 +09:00
parent 14c2439473
commit 87a1ff15fd
1 changed files with 3 additions and 3 deletions

View File

@ -38,9 +38,9 @@ export default function loadScript(url, opts) {
$('script').each((i, tag) => {
const src = tag.getAttribute('src');
// For some reason, a script tag with `url` as the source is appended into
// the head tag while loading the script.
if (src && src !== url) _loaded[tag.getAttribute('src')] = true;
if (src && (opts.scriptTag || src !== url)) {
_loaded[tag.getAttribute('src')] = true;
}
});