mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Calling tinyMCE.init() in sync with entwine rules to avoid uncached loading interfereing with call order (fixes #6877)
This commit is contained in:
parent
8292075174
commit
a64715beeb
@ -129,6 +129,7 @@
|
||||
|
||||
_fixIframeLinks: function() {
|
||||
var doc = this.find('iframe')[0].contentDocument;
|
||||
if(!doc) return;
|
||||
|
||||
// Block outside links from going anywhere
|
||||
var links = doc.getElementsByTagName('A');
|
||||
|
@ -308,7 +308,6 @@ class HtmlEditorConfig {
|
||||
if((typeof tinyMCE != 'undefined')) {
|
||||
$externalPluginsJS
|
||||
var ssTinyMceConfig = " . Convert::raw2json($config) . ";
|
||||
tinyMCE.init(ssTinyMceConfig);
|
||||
}
|
||||
";
|
||||
}
|
||||
|
@ -209,8 +209,17 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
}
|
||||
});
|
||||
|
||||
// Only works after TinyMCE.init() has been invoked, see $(window).bind() call below for details.
|
||||
this.redraw();
|
||||
// Using a global config (generated through HTMLEditorConfig PHP logic).
|
||||
// Depending on browser cache load behaviour, entwine's DOMMaybeChanged
|
||||
// can be called before the bottom-most inline script tag is executed,
|
||||
// which defines the global. If that's the case, wait for the window load.
|
||||
if(typeof ssTinyMceConfig != 'undefined') {
|
||||
this.redraw();
|
||||
} else {
|
||||
$(window).bind('load', function() {
|
||||
self.redraw();
|
||||
});
|
||||
}
|
||||
|
||||
this._super();
|
||||
},
|
||||
@ -219,6 +228,8 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
// Using a global config (generated through HTMLEditorConfig PHP logic)
|
||||
var config = ssTinyMceConfig, self = this, ed = this.getEditor();
|
||||
|
||||
tinyMCE.init(config);
|
||||
|
||||
// Avoid flicker (also set in CSS to apply as early as possible)
|
||||
self.css('visibility', '');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user