From e6f2dc173814482672c44d58b44627f2a13ce9de Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Mon, 7 Jun 2021 14:14:32 +0300 Subject: [PATCH] Fix Hint Manager, add hint in statusbar --- apps/common/main/lib/component/HintManager.js | 14 ++++++++++++-- apps/common/main/lib/view/ReviewChanges.js | 15 ++++++++++++--- .../main/app/template/StatusBar.template | 8 ++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/component/HintManager.js b/apps/common/main/lib/component/HintManager.js index a277932a1..e0eb0d7cd 100644 --- a/apps/common/main/lib/component/HintManager.js +++ b/apps/common/main/lib/component/HintManager.js @@ -207,7 +207,7 @@ Common.UI.HintManager = new(function() { }; var _resetToDefault = function() { - _currentLevel = $('.toolbar-fullview-panel').is(':visible') ? 1 : 0; + _currentLevel = $('#file-menu-panel').is(':visible') ? 1 : 0; _setCurrentSection(); _currentHints.length = 0; _currentControls.length = 0; @@ -222,6 +222,8 @@ Common.UI.HintManager = new(function() { if (e.keyCode == Common.UI.Keys.ALT && _isAlt) { e.preventDefault(); if (!_hintVisible) { + _currentLevel = $('#file-menu-panel').is(':visible') ? 1 : 0; + _setCurrentSection(); _showHints(); } else { _hideHints(); @@ -258,7 +260,15 @@ Common.UI.HintManager = new(function() { _hideHints(); } else { if (!curr.attr('content-target') || (curr.attr('content-target') && !$(`#${curr.attr('content-target')}`).is(':visible'))) { // need to open panel - curr.trigger(jQuery.Event('click', {which: 1})); + if (!($('#file-menu-panel').is(':visible') && (curr.parent().prop('id') === 'fm-btn-info' && $('#panel-info').is(':visible') || + curr.parent().prop('id') === 'fm-btn-settings' && $('#panel-settings').is(':visible')))) { + curr.trigger(jQuery.Event('click', {which: 1})); + } + } + if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options') { + _hideHints(); + _resetToDefault(); + return; } if (curr.prop('id') === 'add-comment-doc') { _removeHints(); diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index ad7c27def..d29e0ecdd 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -708,7 +708,10 @@ define([ checkable: true, toggleGroup: 'menuTurnReviewStb' } - ]}) + ]}), + dataHint: '0', + dataHintDirection: 'top', + dataHintOffset: '2, -16' }); this.btnsTurnReview.push(button); @@ -721,7 +724,10 @@ define([ iconCls: 'toolbar__icon btn-ic-docspell', hintAnchor : 'top', hint: this.tipSetSpelling, - enableToggle: true + enableToggle: true, + dataHint: '0', + dataHintDirection: 'top', + dataHintOffset: 'small' }); this.btnsSpelling.push(button); @@ -732,7 +738,10 @@ define([ iconCls: 'toolbar__icon btn-ic-doclang', hintAnchor : 'top', hint: this.tipSetDocLang, - disabled: true + disabled: true, + dataHint: '0', + dataHintDirection: 'top', + dataHintOffset: 'small' }); this.btnsDocLang.push(button); diff --git a/apps/documenteditor/main/app/template/StatusBar.template b/apps/documenteditor/main/app/template/StatusBar.template index 8b782f6b7..3757a113c 100644 --- a/apps/documenteditor/main/app/template/StatusBar.template +++ b/apps/documenteditor/main/app/template/StatusBar.template @@ -13,7 +13,7 @@
-