pagedown-bootstrap icon indicating copy to clipboard operation
pagedown-bootstrap copied to clipboard

Hooks on the editor object

Open greg-galbraith opened this issue 11 years ago • 2 comments

I'd really like to use this version of the pagedown editor, but I'm having trouble figuring out how to hook up to the editor's onPreviewRefresh event. The standard pagedown editor has the following example in the wiki:

editor.hooks.chain("onPreviewRefresh", function () {
    console.log("the preview has been updated");
});

However, I'm not sure how I'd do something similar using pagedown-bootstrap. Any help is much appreciated!

greg-galbraith avatar Feb 24 '14 19:02 greg-galbraith

https://gist.github.com/kevinoconnor7/5432376#file-advancedusage-html

That should show off how to do it.

kevinoconnor7 avatar Feb 25 '14 03:02 kevinoconnor7

That shows how to access the hooks available for the converter. I was interested in the onPreviewRefresh event/hook, on the editor. I've already made modifications to the pagedownBootstrap initialization that works. I've forked your repo and will probably submit a pull request with those changes when I've got them properly tested.

greg-galbraith avatar Feb 25 '14 03:02 greg-galbraith