UNPKG

grapesjs

Version:

Free and Open Source Web Builder Framework

16 lines (11 loc) 310 B
module.exports = { run(editor) { const sel = editor.getSelected(); let comp = sel && sel.parent(); // Recurse through the parent() chain until a selectable parent is found while (comp && !comp.get("selectable")) { comp = comp.parent(); } comp && editor.select(comp); } };