We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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); } }, };
config: SummernoteOptions = { ...NOTICE_POPUP_SUMMERNOTE_CONFIG, callbacks: { onImageUpload: function(e: any) { console.log(e); } }, };
but onImageUpload is not working
The text was updated successfully, but these errors were encountered:
Did you find a solution to this issue? I have the same problem. Am trying to use onImageUpload Callback and it is not working.
onImageUpload
Sorry, something went wrong.
Your callback is never called, because the directive overrides the onImageUpload callback.
See here:
ngx-summernote/projects/ngx-summernote/src/lib/ngx-summernote.directive.ts
Line 44 in b2b1554
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') }) };
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, };
options.callbacks = { onImageUpload: files => this.uploadImage(files), onMediaDelete: files => this.mediaDelete.emit({ url: $(files[0]).attr('src') }), ...options.callbacks, };
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: