Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David
tinymce
Commits
265b20b0
Commit
265b20b0
authored
Aug 20, 2015
by
Stefan Galinski
🎮
Browse files
[BUGFIX] The RTE isn't loading sometimes
parent
cc3e9dd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Loader.php
View file @
265b20b0
...
...
@@ -123,6 +123,32 @@ class Loader {
$configuration
=
$this
->
tinymceConfiguration
[
'preJS'
];
$configuration
.
=
'
var SG = SG || {};
SG.domIsReady = (function(domIsReady) {
var isBrowserIeOrNot = function() {
return (!document.attachEvent || typeof document.attachEvent === "undefined" ? "not-ie" : "ie");
}
domIsReady = function(callback) {
if(callback && typeof callback === "function"){
if(isBrowserIeOrNot() !== "ie") {
document.addEventListener("DOMContentLoaded", function() {
return callback();
});
} else {
document.attachEvent("onreadystatechange", function() {
if(document.readyState === "complete") {
return callback();
}
});
}
} else {
console.error("The callback is not a function!");
}
}
return domIsReady;
})(SG.domIsReady || {});
SG.initTinyMceLoadFunction = function() {
if (SG.initializedTinyMceLoaderInstance) {
return;
...
...
@@ -132,11 +158,12 @@ class Loader {
SG.initializedTinyMceLoaderInstance = new SG.TinyMceLoader(window.tinymce, {
'
.
$this
->
replaceTypo3Paths
(
$this
->
tinymceConfiguration
[
'configurationData'
])
.
'
});
clearInterval(SG.initTinyMceLoadInterval);
}
};
SG.initTinyMceLoadFunction();
SG.initTinyMceLoadInterval = window.setInterval(SG.initTinyMceLoadFunction, 333);
SG.domIsReady(function() {
SG.initTinyMceLoadFunction();
});
'
;
$configuration
.
=
$this
->
tinymceConfiguration
[
'postJS'
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment