Reputation: 38092
I use Prototype JS as main JS library and I have integrate the last RedactorJS with jQuery in mode no conflict but i can't launch function like :
jQuery('#redactor').redactor('destroy');
OR
jQuery('#redactor').destroy();
ERROR : Error: No such method "destroy" for Redactor
Have you a solution to this problem?
Upvotes: 2
Views: 943
Reputation: 136
The answer of callmehiphop gave me the final hint! Redactor 9 is still broken at this point :( Here's the fix:
if (typeof $('#redactor').data('redactor') != 'undefined') {
// redactor is initialized!
$('#redactor').destroy();
}
Upvotes: 0
Reputation: 4921
Tested with 9.X :
jQuery('#redactor').redactor('getObject').destroy();
Tested with 8.X :
jQuery('#redactor').redactor('getObject').destroyEditor();
Upvotes: 2
Reputation: 646
Not familiar with Redactor at all, but after taking a peak at the source code it looks like they store the Redactor object inside of the corresponding jQuery pointers data object. So I think you should be able to do the following
jQuery('#redactor').data('redactor').destroy();
Upvotes: 0