Browse Source

Merge pull request #691 from tommywulove/dev Closes #668

#668 enhancement
pull/702/head
Artur Arseniev 9 years ago
committed by GitHub
parent
commit
d5551967f5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      src/commands/view/SelectComponent.js

31
src/commands/view/SelectComponent.js

@ -100,6 +100,20 @@ module.exports = {
this.onFrameScroll(e); this.onFrameScroll(e);
this.updateAttached(); this.updateAttached();
} }
var model = $(trg).data('model');
if (model != 'undefined') {
if (!model.get("selectable")) {
var comp = model && model.parent();
// recurse through the parent() chain until a selectable parent is found
while (comp && !comp.get("hoverable")) {
comp = comp.parent();
}
trg = comp.view.el;
}
}
var pos = this.getElementPos(trg); var pos = this.getElementPos(trg);
this.updateBadge(trg, pos); this.updateBadge(trg, pos);
@ -186,7 +200,22 @@ module.exports = {
onClick(e) { onClick(e) {
e.stopPropagation(); e.stopPropagation();
const model = $(e.target).data('model'); const model = $(e.target).data('model');
model && this.editor.select(model); if (typeof model != 'undefined') {
if (model.get("selectable")) {
model && this.editor.select(model);
} else {
var comp = model && model.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