fix bug
This commit is contained in:
parent
24f082156b
commit
35fd903af3
|
@ -8,20 +8,20 @@ const dynamicLoadScript = (src, callback) => {
|
||||||
script.id = src
|
script.id = src
|
||||||
document.body.appendChild(script)
|
document.body.appendChild(script)
|
||||||
|
|
||||||
const onend = 'onload' in script ? stdOnEnd : ieOnEnd
|
const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd
|
||||||
onend(script, cb)
|
onEnd(script, cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingScript && cb) cb()
|
if (existingScript && cb) cb(null, existingScript)
|
||||||
|
|
||||||
function stdOnEnd(script, cb) {
|
function stdOnEnd(script, cb) {
|
||||||
script.onload = function() {
|
script.onload = function() {
|
||||||
|
// this.onload = null here is necessary
|
||||||
|
// because even IE9 works not like others
|
||||||
this.onerror = this.onload = null
|
this.onerror = this.onload = null
|
||||||
cb(null, script)
|
cb(null, script)
|
||||||
}
|
}
|
||||||
script.onerror = function() {
|
script.onerror = function() {
|
||||||
// this.onload = null here is necessary
|
|
||||||
// because even IE9 works not like others
|
|
||||||
this.onerror = this.onload = null
|
this.onerror = this.onload = null
|
||||||
cb(new Error('Failed to load ' + src), script)
|
cb(new Error('Failed to load ' + src), script)
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,9 @@ export default {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.init()
|
if (window.tinymce) {
|
||||||
|
this.initTinymce()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deactivated() {
|
deactivated() {
|
||||||
this.destroyTinymce()
|
this.destroyTinymce()
|
||||||
|
|
Loading…
Reference in New Issue