From e2dc28f757df99a58b936007e86054d2083186dd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 1 Oct 2021 12:40:54 +0200 Subject: [PATCH] Update Droppable endCustom --- docs/modules/Blocks.md | 16 +++++++++------- src/utils/Droppable.js | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/modules/Blocks.md b/docs/modules/Blocks.md index 8cbe28008..665d53552 100644 --- a/docs/modules/Blocks.md +++ b/docs/modules/Blocks.md @@ -315,18 +315,20 @@ const editor = grapesjs.init({ editor.on('block:custom', props => { // The `props` will contain all the information you need in order to update your UI. - // props.open (boolean) - Indicates if the Asset Manager is open - // props.assets (Array) - Array of all assets - // props.types (Array) - Array of asset types requested, eg. ['image'], - // props.close (Function) - A callback to close the Asset Manager - // props.remove (Function) - A callback to remove an asset - // props.select (Function) - A callback to select an asset - // props.container (HTMLElement) - The element where you should append your UI + // props.blocks (Array) - Array of all blocks + // props.dragStart (Function) - A callback to trigger the start of block dragging. + // props.dragStop (Function) - A callback to trigger the stop of block dragging. + // props.container (HTMLElement) - The default element where you can append your UI // Here you would put the logic to render/update your UI. }); ``` +Here an example of using custom Block Manager with a Vue component. + + + + ## Events diff --git a/src/utils/Droppable.js b/src/utils/Droppable.js index 14c2f1b60..11b92a1f6 100644 --- a/src/utils/Droppable.js +++ b/src/utils/Droppable.js @@ -70,7 +70,7 @@ export default class Droppable { } endCustom(cancel) { - this.endDrop(cancel); + this.over ? this.endDrop(cancel) : this.__customTglEff(false); } endDrop(cancel, ev) {