Closed coderhs closed 8 years ago
You can't do this: $('#article').showEditor()
since that would be a new fn
extended from jquery.
Anyway, you can add that in any event inside bootstrap-markdown. e.g:
$("#article").markdown({
autofocus:true,
savable:false,
iconlibrary:'fa',
onShow: function(e) {
e.showEditor();
}
});
Ofcourse the onShow
event does that already, it's just a sample. Hope that helps
An update to this answer: If you really want to do this outside the definition, you can do it like this:
$('#article').data('markdown').showEditor();
provided that you initialized $('#article').markdown( ... )
already.
Thanks for the tip. Ya i have already initialized markdown it, let me try that.
Thanks @lodev09. That's helpful.
Hey there, I wish to make the markdown editor show/hidden on button click.
To make it visible i wrote the following code with in the click trigger
but when i try to use the
$('#article').showEditor()
toggle api. it gives the following errorTypeError: Object [object Object] has no method 'showEditor'
.