Browse Source

skip non-selectable parents in select-parent command

pull/666/head
Ryan Deba 9 years ago
parent
commit
7b88304874
  1. 11
      src/commands/view/SelectParent.js

11
src/commands/view/SelectParent.js

@ -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…
Cancel
Save