Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Calling tinyMCE.init() in sync with entwine rules to avoid unc…

…ached loading interfereing with call order (fixes #6877)
  • Loading branch information...
commit a64715beeb48914b1d9cece001267d96c2e0149c 1 parent 8292075
@chillu chillu authored
View
1  admin/javascript/LeftAndMain.Preview.js
@@ -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');
View
1  forms/HtmlEditorConfig.php
@@ -308,7 +308,6 @@ function generateJS() {
if((typeof tinyMCE != 'undefined')) {
$externalPluginsJS
var ssTinyMceConfig = " . Convert::raw2json($config) . ";
- tinyMCE.init(ssTinyMceConfig);
}
";
}
View
15 javascript/HtmlEditorField.js
@@ -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', '');
Please sign in to comment.
Something went wrong with that request. Please try again.