Added possibility to register for events

This commit is contained in:
Per Kastman
2015-12-03 14:26:25 +01:00
parent 1e9273d62e
commit 3ff68ab822
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -37,3 +37,9 @@ cropboxWithOptions.update();
cropboxWithOptions.getDataURL();
cropboxWithOptions.getBlob();
cropboxWithOptions.remove();
cropboxWithOptions.on("cropbox",(e: Event, data: any, img: jQueryCropBox.Cropbox) => {
//DoStuff
});
+6
View File
@@ -103,7 +103,13 @@ declare module jQueryCropBox {
* Remove the cropbox functionality from the image.
*/
remove(): void;
/**
* Attach an event handler function for one event on the Crop Box
*/
on(event: string, callback: jQueryCropBox.EventCallback): void;
}
type EventCallback = (e: Event, data: any, img: jQueryCropBox.Cropbox) => void;
}
interface JQuery {