|
|
|
|
@ -8,8 +8,8 @@ export const rupluralize = (value, args, addValue = true) => { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export const loadScript = (url, onload) => { |
|
|
|
|
return new Promise(function (resolve, reject) { |
|
|
|
|
for (const script of document.getElementsByTagName('script')) { |
|
|
|
|
return new Promise(resolve => { |
|
|
|
|
for (let script of document.getElementsByTagName('script')) { |
|
|
|
|
if (script.src == url) { |
|
|
|
|
onload && onload(); |
|
|
|
|
resolve(); |
|
|
|
|
@ -22,7 +22,7 @@ export const loadScript = (url, onload) => { |
|
|
|
|
script.onload = function () { |
|
|
|
|
onload && onload.apply(this, arguments); |
|
|
|
|
resolve.apply(this, arguments); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
script.src = url; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|