2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00

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

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;
}
});