I am using Redactor WYSIWYG editor for my content edit. How can I check if redactor has been initialised on certain element ? I am currently checking if element has a class name redactor-editor
, but I guess there must be better way?
$('.btn-edit-content').click(function(e){
e.preventDefault();
if(!$($(this).attr('href')).hasClass('redactor-editor'))
$($(this).attr('href')).redactor({
toolbarFixedTopOffset: 95,
plugins: ['table']
});
})
According to their api doc, you can do something like this
Look at their doc for more help
Hope it's gonna help you