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

Fix/alt key
This commit is contained in:
maxkadushkin 2021-11-15 16:20:16 +03:00 committed by GitHub
commit f20b85b0a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -114,7 +114,8 @@ Common.UI.HintManager = new(function() {
_inputLetters = '',
_isComplete = false,
_isLockedKeyEvents = false,
_inputTimer;
_inputTimer,
_isDocReady = false;
var _api;
@ -370,6 +371,7 @@ Common.UI.HintManager = new(function() {
'app:ready': function (mode) {
var lang = mode.lang ? mode.lang.toLowerCase() : 'en';
_getAlphabetLetters(lang);
_isDocReady = true;
},
'hints:clear': _clearHints,
'window:resize': _clearHints
@ -490,12 +492,13 @@ Common.UI.HintManager = new(function() {
}
}
_needShow = (e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible());
_needShow = (e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady);
});
};
var _getAlphabetLetters = function (lng) {
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/alphabetletters.json', function (langsJson) {
_arrEnAlphabet = langsJson['en'];
var _setAlphabet = function (lang) {
_lang = lang;
_arrAlphabet = langsJson[lang];

View file

@ -476,8 +476,8 @@ define([
iconCls: iconid,
disabled: disabled === true,
dataHint:'0',
dataHintDirection: hintDirection ? hintDirection : 'left',
dataHintOffset: hintOffset ? hintOffset : '10, 10',
dataHintDirection: hintDirection ? hintDirection : (config.isDesktopApp ? 'right' : 'left'),
dataHintOffset: hintOffset ? hintOffset : (config.isDesktopApp ? '10, -10' : '10, 10'),
dataHintTitle: hintTitle
})).render(slot);
}