Commit dfc596ee authored by Samuel Trégouët's avatar Samuel Trégouët
Browse files

fix ajax loading => add interval to wait for CKEDITOR to be loaded

closes #13521675
parent 868de6d79658
......@@ -17,7 +17,17 @@ def fckeditor_config(self):
'//cdn.ckeditor.com/4.5.7/standard/ckeditor.js')
self.add_js(ckeditor_url, localfile=False)
self.add_js('initwysiwyg.js')
self.add_onload('buildWysiwygEditors()')
# we should wait CKEDITOR to be loaded before trying to use it
self.add_onload('''
var buildWysiwygEditorsInterval = setInterval(function() {
if (typeof CKEDITOR != "undefined") {
buildWysiwygEditors();
clearInterval(buildWysiwygEditorsInterval);
} else {
console.log('waiting for CKEDITOR to be loaded');
}
}, 200);
''')
self.html_headers.define_var('cklang', self.lang)
self.html_headers.define_var('ckconfigpath',
self.data_url('ckeditor-config.js'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment