Issue #580Opened November 28, 2017by faizansaiyed3 reactions

[Question] Any/Trigger event when any block is dropped inside canvas?

Question

Hey, How can I trigger some event when any new block or content inside canvas is updated? Something like editor.onCanvasUpdate()

Thanks!

Answers (3)

duskhackerNovember 29, 20171 reactions

When I asked to find out when the canvas is dirty to provide an indicator, @artf told me:

editor.on('change:changesCount', (editorModel, changes) => {
  
    if (changes) {
  // do something with changes 
    } else {
     // do something else with no changes 
    }
  });
  
artfNovember 30, 20171 reactions

I'd add also a block specific event

editor.on('block:drag:stop', model => console.log('dropped ', model))

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.