open confirm dialog before removing assets
Question
I want to open a confirm dialog before removing image from assets manager. There is not any feature at the same time there is no appropriate api for it.
Answers (3)
You can use this code from Assets documentation
// Extend the original `image`
editor.AssetManager.addType('image', {
view: {
onRemove(e) {
e.stopPropagation();
const model = this.model;
confirm('Are you sure?') && model.collection.remove(model);
}
},
})
Put it inside a plugin otherwise it won't take effect on already defined images
@artf Thanks
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #426
After image Upload immediately show in the asset Manager
@ artf I tried my best, but still it doesn't seem to work Can you please help me in this. Once I upload a image I don't want to refresh the...
Issue #1929
Loads asset manager, but assets not working
I'm using the pencil icon to trigger the asset manager. The triggering works fine but when I click on any of the images, no change is refle...
Issue #1439
Removing images from the canvas/LS when deleted from the AM
I upload an image with the assets manager which stores the image on the server. I select the image to insert into the canvas and it stores...
Issue #591
Show hover toottip on block
I want to add hover preview for block under block manager before user add to canvas. is there way to achieve it?
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.