What I need is to simplify dropping elements in a way to speed up page creation.
So if I drop a column and there is no parent row there, I would like to be added automatic.
Same for dropping row. If I drop a row without container it would be nice to be able to add container automatic.
What is the best approach to do that?
hi there! see if this can help you out.
cheers.
I try to solve this with that proposal event. But when I try to drop column somewhere else it does not allow because draggable property for column have value ".row" so on _editor.on('block:drag:stop', function (element)_ element is null if column is dropped out of row. So I ether need to change draggable property to true (as it is on container) and then somehow to check if there is row inside and if not to update content or to find another way to do that.
Any suggestion?
hi!
because draggable property for column have value ".row"
just get rid of this. we do not need draggable here because we are doing the check ourselves:
const parent = element.parent()
/* check the parent type here: */
parent.is('your target type') ? /* do not wrap the component*/ : /* wrap the component */
if you need any further help for your specific case, i would appreciate a fiddle.
cheers.
Most helpful comment
hi!
just get rid of this. we do not need draggable here because we are doing the check ourselves:
if you need any further help for your specific case, i would appreciate a fiddle.
cheers.