[PE] Hide left comments panel by esc.

This commit is contained in:
Julia Radzhabova 2017-10-24 14:56:49 +03:00
parent 5da46ba82c
commit 57c3b5f80b
2 changed files with 17 additions and 0 deletions

View file

@ -98,6 +98,7 @@ define([
'search:next': _.bind(this.onQuerySearch, this, 'next')
}
});
Common.NotificationCenter.on('leftmenu:change', _.bind(this.onMenuChange, this));
},
onLaunch: function() {
@ -574,6 +575,18 @@ define([
menu.hide();
},
onMenuChange: function (value) {
if ('hide' === value) {
if (this.leftMenu.btnComments.isActive() && this.api) {
this.leftMenu.btnComments.toggle(false);
this.leftMenu.onBtnMenuClick(this.leftMenu.btnComments);
// focus to sdk
this.api.asc_enableKeyEvents(true);
}
}
},
textNoTextFound : 'Text not found',
newDocumentTitle : 'Unnamed document',
requestEditRightsText : 'Requesting editing rights...'

View file

@ -293,6 +293,10 @@ define([
$('ul.dropdown-menu', me.currentMenu.el).focus();
}
}
if (key == Common.UI.Keys.ESC) {
Common.UI.Menu.Manager.hideAll();
Common.NotificationCenter.trigger('leftmenu:change', 'hide');
}
}
};