file-upload-with-preview icon indicating copy to clipboard operation
file-upload-with-preview copied to clipboard

how to capture the event with jquery?

Open gomonx opened this issue 1 year ago • 1 comments

how to capture the event with jquery?

gomonx avatar Jul 12 '22 14:07 gomonx

I haven't used jQuery in a while, but I think one way that you could do it would be:

$(window).on('fileUploadWithPreview:imagesAdded', function (e) {
  console.log(e.detail)
});

The above would capture the Event.IMAGE_ADDED event. You can look at src/constants/events.ts to see the other available event strings.

If you search around a bit you should find some further methods around this - one improvement to the above code would be to attach the .on() handler to a parent div rather than the actual window.

Links:

johndatserakis avatar Jul 14 '22 03:07 johndatserakis