Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image upload #172

Open
Seongseokwon opened this issue Feb 1, 2023 · 2 comments
Open

image upload #172

Seongseokwon opened this issue Feb 1, 2023 · 2 comments

Comments

@Seongseokwon
Copy link

I want to use the image upload event, but how should I do it?

i tried this
config: SummernoteOptions = { ...NOTICE_POPUP_SUMMERNOTE_CONFIG, callbacks: { onImageUpload: function(e: any) { console.log(e); } }, };

but onImageUpload is not working

@MalonzaElkanah
Copy link

Did you find a solution to this issue? I have the same problem. Am trying to use onImageUpload Callback and it is not working.

@roy-ganz
Copy link

Your callback is never called, because the directive overrides the onImageUpload callback.

See here:

onImageUpload: files => this.uploadImage(files),

I think this is a bug and the directive should respect custom upload functions.

A simple solution would be probably to give priority to user options.

Instead of
options.callbacks = { ...options.callbacks, onImageUpload: files => this.uploadImage(files), onMediaDelete: files => this.mediaDelete.emit({ url: $(files[0]).attr('src') }) };

Reorder to
options.callbacks = { onImageUpload: files => this.uploadImage(files), onMediaDelete: files => this.mediaDelete.emit({ url: $(files[0]).attr('src') }), ...options.callbacks, };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants