[common] Fix hint manager

This commit is contained in:
JuliaSvinareva 2021-06-22 20:18:23 +03:00
parent a8c09d3200
commit 6dba75830d
3 changed files with 12 additions and 7 deletions

View file

@ -145,11 +145,12 @@ define([
el.toggleClass('selected', this.model.get('selected') && this.model.get('allowSelected'));
if (this.dataHint !== '') {
console.log('tr');
el.attr('data-hint', this.dataHint);
el.attr('data-hint-direction', this.dataHintDirection);
el.attr('data-hint-offset', this.dataHintOffset);
}
if (!_.isUndefined(this.model.get('contentTarget')))
el.attr('content-target', this.model.get('contentTarget'));
el.off('click dblclick contextmenu');
el.on({ 'click': _.bind(this.onClick, this),

View file

@ -137,7 +137,6 @@ Common.UI.HintManager = new(function() {
el.attr('data-hint-title', _arrLetters[index].toUpperCase());
_currentControls.push(el);
});
return _currentControls;
};
var _getHints = function() {
@ -222,6 +221,7 @@ Common.UI.HintManager = new(function() {
if (e.keyCode == Common.UI.Keys.ALT && _isAlt) {
e.preventDefault();
if (!_hintVisible) {
$('input').blur(); // to change value in inputField
_currentLevel = $('#file-menu-panel').is(':visible') ? 1 : 0;
_setCurrentSection();
_showHints();
@ -262,10 +262,14 @@ Common.UI.HintManager = new(function() {
if (!curr.attr('content-target') || (curr.attr('content-target') && !$(`#${curr.attr('content-target')}`).is(':visible'))) { // need to open panel
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.attr('for')) { // to trigger event in checkbox
$(`#${curr.attr('for')}`).trigger(jQuery.Event('click', {which: 1}));
} else {
curr.trigger(jQuery.Event('click', {which: 1}));
}
}
}
if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options') {
if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options' || curr.prop('id') === 'left-btn-thumbs') {
_hideHints();
_resetToDefault();
return;

View file

@ -212,9 +212,9 @@ define([
this.viewSettingsPicker = new Common.UI.DataView({
el: $markup.findById('#id-settings-menu'),
store: new Common.UI.DataViewStore([
{name: this.txtGeneral, panel: this.generalSettings, iconCls:'toolbar__icon btn-settings', selected: true},
{name: this.txtPageSettings, panel: this.printSettings, iconCls:'toolbar__icon btn-print'},
{name: this.txtSpellChecking, panel: this.spellcheckSettings, iconCls:'toolbar__icon btn-ic-docspell'}
{name: this.txtGeneral, panel: this.generalSettings, iconCls:'toolbar__icon btn-settings', contentTarget: 'panel-settings-general', selected: true},
{name: this.txtPageSettings, panel: this.printSettings, iconCls:'toolbar__icon btn-print', contentTarget: 'panel-settings-print'},
{name: this.txtSpellChecking, panel: this.spellcheckSettings, iconCls:'toolbar__icon btn-ic-docspell', contentTarget: 'panel-settings-spellcheck'}
]),
itemTemplate: _.template([
'<div id="<%= id %>" class="settings-item-wrap">',