mirror of
https://github.com/documize/community.git
synced 2025-07-28 09:39:42 +02:00
bug fix for double key-binding
This commit is contained in:
parent
ef9097b4f4
commit
585c4468c1
1 changed files with 5 additions and 2 deletions
|
@ -48,7 +48,11 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
didRender() {
|
didRender() {
|
||||||
let msContainer = document.getElementById(this.get('containerId'));
|
let msContainer = document.getElementById(this.get('containerId'));
|
||||||
let mousetrap = new Mousetrap(msContainer);
|
let mousetrap = this.get('mousetrap');
|
||||||
|
|
||||||
|
if (is.null(mousetrap)) {
|
||||||
|
mousetrap = new Mousetrap(msContainer);
|
||||||
|
}
|
||||||
|
|
||||||
mousetrap.bind('esc', () => {
|
mousetrap.bind('esc', () => {
|
||||||
this.send('onCancel');
|
this.send('onCancel');
|
||||||
|
@ -68,7 +72,6 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
let drop = this.get('drop');
|
let drop = this.get('drop');
|
||||||
|
|
||||||
if (is.not.null(drop)) {
|
if (is.not.null(drop)) {
|
||||||
drop.destroy();
|
drop.destroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue