I use this rich text: https://github.com/bootstrap-wysiwyg/bootstrap3-wysiwyg
It works fine, but I need get the wysihtml5 editor object for run some commands
The doc said I can get wysihtml5 editor object use this code:
var wysihtml5Editor = $('#some-textarea').data("wysihtml5").editor;
wysihtml5Editor.composer.commands.exec("bold");
But wysihtml5Editor is aways undefined
log the $('#some-textarea').data("wysihtml5") print this:
Wysihtml5 {el: n.fn.init[1], toolbar: n.fn.init[1], editor:undefined}
How to get the editor object?
I found the answer by myself, but anyway thanks Daemedeor and DA.!
in bootstrap3-wysihtml5.js the createEditor method not return , so
this.editor is undefined
I add the return like this
everything is ok!