I m using TinyMCE on the text-areas in my Magento admin section. I have my TinyMCE editor visible form the start, but I want the option to disable/re-enable it.
I m using the jQuery plugin version, so I added some script, which is almost working. However, it s only affecting the first instance of TinyMCE - if there are any other instances of it on the page, they are not affected.
I used this example http://tinymce.moxiecode.com/examples/example_23.php as a base for what I ve done so far. But still can t figure out why it s affecting the first instance only. Any ideas? Here s my code:
var $j = jQuery.noConflict();
// Add ON OFF toggle switch
$j(function() {
$j( textarea ).after("<br/><span class="toggle form-button">Toggle TinyMCE</span>");
$j("span.toggle").toggle(function(){
$j( .wrapper ).find( textarea ).tinymce().hide();
}, function () {
$j( .wrapper ).find( textarea ).tinymce().show();
});
});