Issue #1573Opened November 12, 2018by crypto-dump1 reactions

Open modal after drop element

Question

How to show custom modal dialog when drop element on editor? like asset modal dialog appears when drop image block to the editor.

Answers (3)

mcsekar12November 13, 20180 reactions
Code SnippetTEXT
Use Editor events 
[https://grapesjs.com/docs/api/editor.html#available-events](https://grapesjs.com/docs/api/editor.html#available-events)
`editor.on('component:add', (model, argument) => {
        //filter using component name       
        if (model.getName() === 'modelName') {
          //show modal
        }
        //filter using css Class
        if (model.getAttrToHTML().class === 'className') {
          //show model
        }
      });`
crypto-dumpNovember 13, 20180 reactions

Thanks. I'm new to this plugin. How to create my own modal dialog that has checkbox or select options or etc ?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.