Browse Source

Try to find a closest model when an element, without it, is selected

pull/1151/head
Artur Arseniev 9 years ago
parent
commit
e70931a440
  1. 11
      src/commands/view/SelectComponent.js

11
src/commands/view/SelectComponent.js

@ -188,8 +188,17 @@ module.exports = {
*/
onClick(e) {
e.stopPropagation();
const model = $(e.target).data('model');
const $el = $(e.target);
const editor = this.editor;
let model = $el.data('model');
if (!model) {
let parent = $el.parent();
while (!model && parent) {
model = parent.data('model');
parent = parent.parent();
}
}
if (model) {
if (model.get('selectable')) {

Loading…
Cancel
Save