Merge pull request #1345 from ONLYOFFICE/fix/alt-key

Fix/alt key
This commit is contained in:
Julia Radzhabova 2021-11-23 21:43:47 +03:00 committed by GitHub
commit ba6ae8d647
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 20 deletions

View file

@ -120,7 +120,11 @@ Common.UI.HintManager = new(function() {
var _api;
var _setCurrentSection = function (btn) {
var _setCurrentSection = function (btn, section) {
if (section) {
_currentSection = section;
return;
}
if (btn === 'esc') {
if (_currentLevel === 0) {
_currentSection = document;
@ -172,11 +176,15 @@ Common.UI.HintManager = new(function() {
clearInterval(_inputTimer);
};
var _nextLevel = function() {
var _nextLevel = function(level) {
_removeHints();
_currentHints.length = 0;
_currentControls.length = 0;
_currentLevel++;
if (level !== undefined) {
_currentLevel = level;
} else {
_currentLevel++;
}
};
var _prevLevel = function() {
@ -476,8 +484,9 @@ Common.UI.HintManager = new(function() {
_resetToDefault();
return;
}
var needOpenPanel = (curr.attr('content-target') && !$('#' + curr.attr('content-target')).is(':visible'));
if (!curr.attr('content-target') || needOpenPanel) { // need to open panel
var needOpenPanel = (curr.attr('content-target') && !$('#' + curr.attr('content-target')).is(':visible') ||
(curr.parent().prop('id') === 'slot-btn-chat' && !$('#left-panel-chat').is(':visible')));
if ((!curr.attr('content-target') && curr.parent().prop('id') !== 'slot-btn-chat') || needOpenPanel) { // 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')))) {
if (curr.attr('for')) { // to trigger event in checkbox
@ -503,8 +512,13 @@ Common.UI.HintManager = new(function() {
return;
}
if (!_isComplete) {
_nextLevel();
_setCurrentSection(curr);
if (curr.parent().prop('id') === 'slot-btn-chat') {
_nextLevel(1);
_setCurrentSection(undefined, $('#left-menu.hint-section'));
} else {
_nextLevel();
_setCurrentSection(curr);
}
_showHints();
if (_currentHints.length < 1) {
_resetToDefault();
@ -516,7 +530,7 @@ Common.UI.HintManager = new(function() {
}
}
_needShow = (e.keyCode == Common.UI.Keys.ALT && (!Common.Utils.ModalWindow.isVisible()) && _isDocReady);
_needShow = (e.keyCode == Common.UI.Keys.ALT && (!Common.Utils.ModalWindow.isVisible()) && _isDocReady && _arrAlphabet.length > 0);
});
};

View file

@ -155,7 +155,7 @@ define([
'<tr>',
'<% _.each(row, function(item) { %>',
'<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>">',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>" data-hint="2" data-hint-direction="left-top" data-hint-offset="4, 4">',
'<use xlink:href="#svg-format-<%= item.imgCls %>"></use>',
'</svg></div></td>',
'<% } %>',
@ -912,14 +912,14 @@ define([
'<div class="thumb-list">',
'<% if (blank) { %> ',
'<div class="blank-document">',
'<div class="blank-document-btn">',
'<div class="blank-document-btn" data-hint="2" data-hint-direction="left-top" data-hint-offset="2, 10">',
'<svg class="btn-blank-format"><use xlink:href="#svg-format-blank"></use></svg>',
'</div>',
'<div class="title"><%= scope.txtBlank %></div>',
'</div>',
'<% } %>',
'<% _.each(docs, function(item, index) { %>',
'<div class="thumb-wrap" template="<%= item.url %>">',
'<div class="thumb-wrap" template="<%= item.url %>" data-hint="2" data-hint-direction="left-top" data-hint-offset="14, 22">',
'<div class="thumb" ',
'<% if (!_.isEmpty(item.image)) {%> ',
' style="background-image: url(<%= item.image %>);">',

View file

@ -442,7 +442,9 @@ define([
parentEl: $('#table-btn-distrub-rows', me.$el),
cls: 'btn-toolbar',
iconCls: 'toolbar__icon distribute-rows',
hint: this.textDistributeRows
hint: this.textDistributeRows,
dataHint: '1',
dataHintDirection: 'top'
});
this.lockedControls.push(this.btnDistributeRows);
this.btnDistributeRows.on('click', _.bind(function(btn){
@ -453,7 +455,10 @@ define([
parentEl: $('#table-btn-distrub-cols', me.$el),
cls: 'btn-toolbar',
iconCls: 'toolbar__icon distribute-columns',
hint: this.textDistributeCols
hint: this.textDistributeCols,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.lockedControls.push(this.btnDistributeCols);
this.btnDistributeCols.on('click', _.bind(function(btn){
@ -471,7 +476,10 @@ define([
cls : 'btn-toolbar',
iconCls : 'toolbar__icon table-to-text',
caption : this.textConvert,
style : 'width: 100%;text-align: left;'
style : 'width: 100%;text-align: left;',
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
});
this.btnConvert.on('click', _.bind(this.onConvertTable, this));
this.lockedControls.push(this.btnConvert);

View file

@ -143,7 +143,7 @@ define([
'<tr>',
'<% _.each(row, function(item) { %>',
'<% if (item.type!==Asc.c_oAscFileType.PPTM || fileType=="pptm") { %>',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>">',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>" data-hint="2" data-hint-direction="left-top" data-hint-offset="4, 4">',
'<use xlink:href="#svg-format-<%= item.imgCls %>"></use>',
'</svg></div></td>',
'<% } %>',
@ -769,14 +769,14 @@ define([
'<div class="thumb-list">',
'<% if (blank) { %> ',
'<div class="blank-document">',
'<div class="blank-document-btn">',
'<div class="blank-document-btn" data-hint="2" data-hint-direction="left-top" data-hint-offset="10, 1">',
'<svg class="btn-blank-format"><use xlink:href="#svg-format-blank"></use></svg>',
'</div>',
'<div class="title"><%= scope.txtBlank %></div>',
'</div>',
'<% } %>',
'<% _.each(docs, function(item, index) { %>',
'<div class="thumb-wrap" template="<%= item.url %>">',
'<div class="thumb-wrap" template="<%= item.url %>" data-hint="2" data-hint-direction="left-top" data-hint-offset="22, 13">',
'<div class="thumb" ',
'<% if (!_.isEmpty(item.image)) {%> ',
' style="background-image: url(<%= item.image %>);">',

View file

@ -136,7 +136,7 @@ define([
'<tr>',
'<% _.each(row, function(item) { %>',
'<% if (item.type!==Asc.c_oAscFileType.XLSM || fileType=="xlsm") { %>',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>">',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>" data-hint="2" data-hint-direction="left-top" data-hint-offset="4, 4">',
'<use xlink:href="#svg-format-<%= item.imgCls %>"></use>',
'</svg></div></td>',
'<% } %>',
@ -1736,14 +1736,14 @@ define([
'<div class="thumb-list">',
'<% if (blank) { %> ',
'<div class="blank-document">',
'<div class="blank-document-btn">',
'<div class="blank-document-btn" data-hint="2" data-hint-direction="left-top" data-hint-offset="10, 1">',
'<svg class="btn-blank-format"><use xlink:href="#svg-format-blank"></use></svg>',
'</div>',
'<div class="title"><%= scope.txtBlank %></div>',
'</div>',
'<% } %>',
'<% _.each(docs, function(item, index) { %>',
'<div class="thumb-wrap" template="<%= item.url %>">',
'<div class="thumb-wrap" template="<%= item.url %>" data-hint="2" data-hint-direction="left-top" data-hint-offset="22, 13">',
'<div class="thumb" ',
'<% if (!_.isEmpty(item.image)) {%> ',
' style="background-image: url(<%= item.image %>);">',