Closed Maltretieren closed 10 years ago
You can do it like this:
$('#md').markdown({
onShow: function(e) {
var $md = e;
$('#external-btn').on('click', function(e) {
// trigger the hook
$md.$options.onSave($md);
});
},
onSave: function(e) {
console.log('saving ...');
}
});
Let me know if that works for you. :)
@lodev09 Just an FYI. I had the same requirement and used the sample provided and it works great. Thanks!
No problem @baldwinSPC . @toopay , I think you need to close this one. :)
I want to build an external "Save" button. Is it possible to trigger an event (save) from outside, so the onSave hook gets fired?