diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js index 8b3ff716a..67571b283 100644 --- a/apps/common/main/lib/controller/HintManager.js +++ b/apps/common/main/lib/controller/HintManager.js @@ -116,7 +116,8 @@ Common.UI.HintManager = new(function() { _isLockedKeyEvents = false, _inputTimer, _isDocReady = false, - _isEditDiagram = false; + _isEditDiagram = false, + _usedTitles = []; var _api; @@ -195,10 +196,21 @@ Common.UI.HintManager = new(function() { }; var _getLetters = function(countButtons) { - var arr = _arrAlphabet.slice(); - arr[0] = _arrAlphabet[0] + _arrAlphabet[0]; - for (var i = 1; arr.length < countButtons; i++) { - arr.push(_arrAlphabet[0] + _arrAlphabet[i]); + var arr = _arrAlphabet.slice(), + firstFreeLetter, + ind; + for (var i = 0; i < _arrAlphabet.length, !firstFreeLetter; i++) { + if (_usedTitles.indexOf(_arrAlphabet[i]) === -1) { + firstFreeLetter = _arrAlphabet[i]; + ind = i; + } + } + arr[ind] = firstFreeLetter + _arrAlphabet[0]; + for (var i = 0; arr.length < countButtons; i++) { + var addTip = firstFreeLetter + _arrAlphabet[i]; + if (addTip !== arr[ind]) { + arr.push(firstFreeLetter + _arrAlphabet[i]); + } } return arr; }; @@ -209,6 +221,7 @@ Common.UI.HintManager = new(function() { var _getControls = function() { _currentControls = []; + _usedTitles = []; var arr = [], arrItemsWithTitle = []; if (_.isArray(_currentSection)) { @@ -249,6 +262,14 @@ Common.UI.HintManager = new(function() { } var _arrLetters = []; if (visibleItems.length > _arrAlphabet.length) { + visibleItemsWithTitle.forEach(function (item) { + var t = $(item).data('hint-title').toLowerCase(); + if (_arrAlphabet.indexOf(t) === -1) { + var ind = _arrEnAlphabet.indexOf(t); + t = _arrAlphabet[ind]; + } + _usedTitles.push(t); + }); _arrLetters = _getLetters(visibleItems.length); } else { _arrLetters = _arrAlphabet.slice(); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index dbf31892a..9ed7be3d9 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -142,7 +142,7 @@ define([ {caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'}, {caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'}, {caption: me.textTabTransitions, action: 'transit', extcls: 'canedit', dataHintTitle: 'N'}, - {caption: me.textTabAnimation, action: 'animate', extcls: 'canedit'}, + {caption: me.textTabAnimation, action: 'animate', extcls: 'canedit', dataHintTitle: 'A'}, undefined, undefined, {caption: me.textTabView, action: 'view', extcls: 'canedit', layoutname: 'toolbar-view', dataHintTitle: 'W'} ]