MattKetmo / darkroomjs

Extensible image editing tool in your browser
https://mattketmo.github.io/darkroomjs
MIT License
1.42k stars 405 forks source link

Set up save event by initialization of darkroom.js #19

Closed ivanovicova closed 10 years ago

ivanovicova commented 10 years ago

Currently we are only able to set up save event to true or false - save: { }

We need to run/make JS callback after clicking on Save icon.

Is it possible to add this function?

c7nj7n commented 10 years ago

Actually the save is "just" a plugin. When setting it to "false" you actually desactivate the plugin (and the button disappears). What I did is using a different button in order to apply my scenario. The cleanest way would be to actually write your custom plugin, do you confirm @MattKetmo ?

MattKetmo commented 10 years ago

We could imagine to add a custom callback option to the plugin. By default, this callback would transform the canvas to image (as it do actually), and then you could add your own logic without adding a new plugin.

c7nj7n commented 10 years ago

I like this approach, go for it @MattKetmo !

ivanovicova commented 10 years ago

Ok, could you please add custom callback? Then we will try to add our own logic.

MattKetmo commented 10 years ago

done via cac23973