Issue #1420Opened September 12, 2018by sureshDurai1230 reactions

Customizing Block(section block) While Dragging it

Question

Hi I have seen that there was two separate blocks to add 'sections' and 'columns'.We have a flow like when we drag a section into canvas need to show a popup on that we manually able select the section to be one column section/two column section,how do we achieve this.

And also we have seen the method editor.on('component:selected' which is triggered while dropping the block ,Is we need to use this to customize the section separation then how we do this.

Thanks in advance

Answers (3)

nojackoSeptember 12, 20180 reactions

If your sections always require 1 or 2 columns, why not remove the section and column blocks, instead, add new blocks for "section with 1 column" and "section with 2 columns" and save the popup?

sureshDurai123September 12, 20180 reactions

Yeah it is possible only .But we have the requirement that we need to show single section to customer and based their pick in popup only we need to split it.

nojackoSeptember 12, 20180 reactions

Ok. In that case, it's the canvas:drop event. Hook into that, check it's a section and open your modal. I'm not sure on how you insert the columns but hope this helps.

    editor.on('canvas:drop', (dataTransfer, model) => {
        if (model.is('section')) { // <-- might not be called 'section' 
            // Open your modal and do your thing...
        }
    });

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.