Browse Source

Merge pull request #666 from ryandeba/select-parent-find-closest-selectable Closes #660

skip non-selectable parents in select-parent command
pull/671/head
Artur Arseniev 9 years ago
committed by GitHub
parent
commit
2d93a87b24
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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