From fa12b8912bfdd00d86e7ad7088328779c5592d12 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 20 Jun 2017 12:39:16 +0300 Subject: [PATCH] [DE][SSE] Use commenting display option when show/hide panels in the left menu. --- apps/documenteditor/main/app/view/LeftMenu.js | 6 ++++++ apps/spreadsheeteditor/main/app/view/LeftMenu.js | 6 ++++++ 2 files changed, 12 insertions(+) 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);