Browse Source

Fix select component command

pull/36/head
Artur Arseniev 10 years ago
parent
commit
0b2bd383f5
  1. 2
      dist/grapes.min.js
  2. 18
      src/commands/view/SelectComponent.js

2
dist/grapes.min.js

File diff suppressed because one or more lines are too long

18
src/commands/view/SelectComponent.js

@ -66,15 +66,17 @@ define(function() {
var key = e.which || e.keyCode;
var comp = this.editorModel.get('selectedComponent');
var focused = document.activeElement.tagName !== 'BODY';
if((key == 8 || key == 46) && comp && !focused) {
if(!comp.get('removable'))
return;
comp.set('status','');
comp.destroy();
this.removeBadge();
this.clean();
this.editorModel.set('selectedComponent',null);
if(key == 8 || key == 46) {
e.preventDefault();
if(comp && !focused){
if(!comp.get('removable'))
return;
comp.set('status','');
comp.destroy();
this.removeBadge();
this.clean();
this.editorModel.set('selectedComponent',null);
}
}
},

Loading…
Cancel
Save