Browse Source

Fix select component command

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

2
dist/grapes.min.js

File diff suppressed because one or more lines are too long

6
src/commands/view/SelectComponent.js

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

Loading…
Cancel
Save