mirror of https://github.com/artf/grapesjs.git
committed by
GitHub
1 changed files with 8 additions and 3 deletions
@ -1,9 +1,14 @@ |
|||
module.exports = { |
|||
|
|||
run(editor) { |
|||
const comp = editor.getSelected(); |
|||
const coll = comp && comp.collection; |
|||
coll && coll.parent && editor.select(coll.parent); |
|||
var comp = editor.getSelected() && editor.getSelected().parent(); |
|||
|
|||
// recurse through the parent() chain until a selectable parent is found
|
|||
while (comp && !comp.get("selectable")) { |
|||
comp = comp.parent(); |
|||
} |
|||
|
|||
comp && editor.select(comp); |
|||
} |
|||
|
|||
}; |
|||
|
|||
Loading…
Reference in new issue