From ef3fbc630bf8ac1c9dd1c84be12e3762c657d36e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 25 Apr 2017 11:54:45 +0300 Subject: [PATCH] [DE] Review: close tooltip in statusbar when review button is pressed off. --- apps/common/main/lib/component/SynchronizeTip.js | 4 ++++ apps/documenteditor/main/app/controller/Statusbar.js | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/SynchronizeTip.js b/apps/common/main/lib/component/SynchronizeTip.js index bdb58448a0..a6c3f24eda 100644 --- a/apps/common/main/lib/component/SynchronizeTip.js +++ b/apps/common/main/lib/component/SynchronizeTip.js @@ -99,6 +99,10 @@ define([ : tipEl.css({top : showxy.top + this.target.height()/2 + 'px', left: showxy.left + this.target.width() + 'px'}); }, + isVisible: function() { + return tipEl && tipEl.is(':visible'); + }, + textDontShow : 'Don\'t show this message again', textSynchronize : 'The document has been changed by another user.
Please click to save your changes and reload the updates.' } diff --git a/apps/documenteditor/main/app/controller/Statusbar.js b/apps/documenteditor/main/app/controller/Statusbar.js index 71b60f9ada..9edfb6c566 100644 --- a/apps/documenteditor/main/app/controller/Statusbar.js +++ b/apps/documenteditor/main/app/controller/Statusbar.js @@ -104,7 +104,8 @@ define([ } }); - Common.NotificationCenter.on('app:ready', me.onAppReady.bind(this)); + Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me)); + Common.NotificationCenter.on('reviewchanges:turn', me.onTurnPreview.bind(me)); }, onAppReady: function (config) { @@ -155,6 +156,13 @@ define([ }); }, + onTurnPreview: function(state) { + if (state == 'off' && this.changesTooltip && this.changesTooltip.isVisible()) { + this.changesTooltip.hide(); + this.btnTurnReview.updateHint(this.tipReview); + } + }, + setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onZoomChange', _.bind(this._onZoomChange, this));