21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1443 Views |
-
Firefox 11 and multiple TinyMCE HTMLTextFields

3 April 2012 at 9:21pm
Hi,
I had a problem with multiple TinyMCE editors in the latest release of Firefox (11) not being displayed.
Silverstripe 3 wont have this problem, because TinyMCE will probably be the latest version.For anyone who had the same problem, i found a temporarily solution for Silverstripe 2.4:
in your _config.php include a custom js file for the cms:
LeftAndMain::require_javascript('mysite/javascript/cms.js');
in this javacsript add the folowing:
Behaviour.register({
'#Form_EditForm' : {
initialize : function() {
this.observeMethod('PageLoaded', this.adminPageHandler);
this.adminPageHandler();
},
adminPageHandler : function() {jQuery(window).load( function() {
jQuery(".mceEditor .mceLayout").each(function(i,ele){
jQuery("#"+ele.id).css('width',jQuery("#"+ele.id).width()+10)
});
});}
}
});Credits for the fix for older tinmce version in firefox 11 go to:
http://stackoverflow.com/questions/9837629/tinymce-and-firefox-11Hope this helps you.
Cheers,
Bart
-
Re: Firefox 11 and multiple TinyMCE HTMLTextFields

3 April 2012 at 9:43pm
Above solution does not work after all, hope anyone else did manage to solve it
-
Re: Firefox 11 and multiple TinyMCE HTMLTextFields

4 April 2012 at 1:25am
Kind of a lonely conversation with myself but the js needs to be the following to fix it:
Behaviour.register({
'#Form_EditForm' : {
initialize : function() {
this.observeMethod('PageLoaded', this.adminPageHandler);
this.adminPageHandler();
},
adminPageHandler : function() {},
onload : function() {
jQuery(".mceEditor .mceLayout").each(function(i,ele){
jQuery("#"+ele.id).css('width',jQuery("#"+ele.id).width()+1)
});
}
}
});cheers,
Bart
-
Re: Firefox 11 and multiple TinyMCE HTMLTextFields

11 April 2012 at 1:12am
Thanks, Bart - I've been looking out for a fix for this!
Has anyone resolved it for front end forms? We've got some sites with fairly complicated forms for end users and the same thing happens.
-
Re: Firefox 11 and multiple TinyMCE HTMLTextFields

19 April 2012 at 1:33am
We've managed to figure this out, albeit slightly crudely. In the ss template file add the following:
<script type="text/javascript">
var FIREFOX = /Firefox/i.test(navigator.userAgent);
if (FIREFOX) {
jQuery(window).load( function() {
jQuery(".mceEditor .mceLayout iframe").each(function(i,ele){
jQuery(this).css('width',jQuery(this).width()+1);
});
});
}
</script> -
Re: Firefox 11 and multiple TinyMCE HTMLTextFields

19 April 2012 at 1:41am
The issue is also happening when using a DataObjectManager popup with multiple editors.
Has anyone experienced the same issue?
-
Re: Firefox 11 and multiple TinyMCE HTMLTextFields

19 April 2012 at 2:13am Last edited: 19 April 2012 2:13am
This patch is crude, but it works! Essentially add a literal field to the DataObjectManager popup with the appropriate JS in it:
class MyDataObject extends DataObject{
$FFpatch = '<script type="text/javascript">var FIREFOX = /Firefox/i.test(navigator.userAgent);if (FIREFOX) {jQuery(window).load( function() {jQuery(".mceEditor .mceLayout iframe").each(function(i,ele){jQuery(this).css(\'width\',jQuery(this).width()+1);});});}</script>';
public function getCMSFields_forPopup()
{
...
return new FieldSet(
...
new LiteralField("FFPatch", $FFpatch)
);}
}
| 1443 Views | ||
|
Page:
1
|
Go to Top |



