diff -r a2342f26c9de -r b0b56e0f8c7f server/bo_client/app/mixins/cell-editing-mixin.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/bo_client/app/mixins/cell-editing-mixin.js Fri Jan 15 15:35:00 2016 +0100 @@ -0,0 +1,24 @@ +import Ember from 'ember'; +import ClickOutsideMixin from 'bo-client/mixins/click-outside-mixin'; + +export default Ember.Mixin.create(ClickOutsideMixin, { + isEditing: false, + // override from ClickOutsideMixin + onOutsideClickEnabled: Ember.computed.bool('isEditing'), + + onOutsideClick() { + this.set('isEditing', false); + }, + click() { + var _this = this; + setTimeout(() => { + _this.set('isEditing', true); + }, 200); + }, + keyDown(event) { + if(event.which === this.get('constants').KEY_CODES.ESCAPE) { + this.set('isEditing', false); + } + }, + +});