Skip to content
GitLab
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
c8feee41
Commit
c8feee41
authored
Mar 02, 2015
by
Stefan Galinski
🎮
Browse files
[BUGFIX] Load the tinymce loader also if the code is added after the load event (IRRE)
parent
7bd8c9fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Loader.php
View file @
c8feee41
...
...
@@ -113,20 +113,30 @@ class Loader {
/**
* Returns a file that contains the tinyMCE configuration
*
* Note: The load dom event cannot be used, because e.g. IRRE adds the javascript
* later on. This leads to code that is never executed. The interval timer hack fixes this
* issue.
*
* @return string
*/
protected
function
getConfiguration
()
{
$configuration
=
$this
->
tinymceConfiguration
[
'preJS'
];
$configuration
.
=
'
document.addEventListener(
"DOMContentLoaded", function() {
if (window.tinymce && window.tinymce.init) {
(new SG.TinyMceLoader(window.tinymce, {
'
.
$this
->
replaceTypo3Paths
(
$this
->
tinymceConfiguration
[
'configurationData'
])
.
'
}));
}
}, false
);
var SG = SG || {};
SG.initTinyMceLoadFunction = function() {
if (SG.initializedTinyMceLoaderInstance) {
return;
}
if (SG.TinyMceLoader && window.tinymce && window.tinymce.init) {
SG.initializedTinyMceLoaderInstance = new SG.TinyMceLoader(window.tinymce, {
'
.
$this
->
replaceTypo3Paths
(
$this
->
tinymceConfiguration
[
'configurationData'
])
.
'
});
clearInterval(SG.initTinyMceLoadInterval);
}
};
SG.initTinyMceLoadFunction();
SG.initTinyMceLoadInterval = window.setInterval(SG.initTinyMceLoadFunction, 1000);
'
;
$configuration
.
=
$this
->
tinymceConfiguration
[
'postJS'
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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