diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 969aaca5c..7f96d0fde 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -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...' diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index aed4eb48b..c7da5d988 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -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'); + } } };