Fix Hint Manager, add hint in statusbar

This commit is contained in:
JuliaSvinareva 2021-06-07 14:14:32 +03:00
parent f151aad64f
commit e6f2dc1738
3 changed files with 28 additions and 9 deletions

View file

@ -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();

View file

@ -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);

View file

@ -13,7 +13,7 @@
<div class="status-group" style="">
<div class="separator short el-edit"></div>
<div class="cnt-lang el-edit">
<div class="dropdown-toggle" data-toggle="dropdown" style="margin-right: 6px;">
<div class="dropdown-toggle" data-toggle="dropdown" style="margin-right: 6px;" data-hint="0" data-hint-direction="top">
<label id="status-label-lang" class="status-label">English (United States)</label>
<div class="caret up img-commonctrl"></div>
</div>
@ -23,11 +23,11 @@
<div class="separator short el-edit"></div>
<div id="btn-doc-review" class="el-edit el-review" style="display: inline-block;"></div>
<div class="separator short el-edit el-review"></div>
<button id="btn-zoom-topage" type="button" class="btn small btn-toolbar"><span class="icon toolbar__icon btn-ic-zoomtopage">&nbsp;</span></button>
<button id="btn-zoom-towidth" type="button" class="btn small btn-toolbar"><span class="icon toolbar__icon btn-ic-zoomtowidth">&nbsp;</span></button>
<button id="btn-zoom-topage" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-ic-zoomtopage">&nbsp;</span></button>
<button id="btn-zoom-towidth" type="button" class="btn small btn-toolbar" data-hint="0" data-hint-direction="top" data-hint-offset="small"><span class="icon toolbar__icon btn-ic-zoomtowidth">&nbsp;</span></button>
<button id="btn-zoom-down" type="button" class="btn small btn-toolbar"><span class="icon toolbar__icon btn-zoomdown">&nbsp;</span></button>
<div class="cnt-zoom">
<div class="dropdown-toggle" data-toggle="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown" data-hint="0" data-hint-direction="top">
<label id="label-zoom" class="status-label">Zoom 100%</label>
</div>
</div>