diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index d85aafee2..2e12e3027 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -145,6 +145,7 @@ define([ this.btnChat.hide(); this.btnComments.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnComments.on('toggle', _.bind(this.onBtnCommentsToggle, this)); this.btnChat.on('click', _.bind(this.onBtnMenuClick, this)); /** coauthoring end **/ @@ -185,6 +186,11 @@ define([ Common.NotificationCenter.trigger('layout:changed', 'leftmenu'); }, + onBtnCommentsToggle: function(btn, state) { + if (!state) + this.fireEvent('comments:hide', this); + }, + onBtnMenuClick: function(btn, e) { this.supressEvents = true; this.btnFile.toggle(false); diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index fe6993d63..b0925d031 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -135,6 +135,7 @@ define([ this.btnChat.hide(); this.btnComments.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnComments.on('toggle', _.bind(this.onBtnCommentsToggle, this)); this.btnChat.on('click', _.bind(this.onBtnMenuClick, this)); /** coauthoring end **/ @@ -177,6 +178,11 @@ define([ Common.NotificationCenter.trigger('layout:changed', 'leftmenu'); }, + onBtnCommentsToggle: function(btn, state) { + if (!state) + this.fireEvent('comments:hide', this); + }, + onBtnMenuClick: function(btn, e) { this.btnFile.toggle(false); this.btnAbout.toggle(false);