[DE PE SSE] Fix hint manager
This commit is contained in:
parent
ebb71c0e94
commit
0d62988f44
|
@ -116,7 +116,8 @@ Common.UI.HintManager = new(function() {
|
||||||
_isLockedKeyEvents = false,
|
_isLockedKeyEvents = false,
|
||||||
_inputTimer,
|
_inputTimer,
|
||||||
_isDocReady = false,
|
_isDocReady = false,
|
||||||
_isEditDiagram = false;
|
_isEditDiagram = false,
|
||||||
|
_usedTitles = [];
|
||||||
|
|
||||||
var _api;
|
var _api;
|
||||||
|
|
||||||
|
@ -195,10 +196,21 @@ Common.UI.HintManager = new(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
var _getLetters = function(countButtons) {
|
var _getLetters = function(countButtons) {
|
||||||
var arr = _arrAlphabet.slice();
|
var arr = _arrAlphabet.slice(),
|
||||||
arr[0] = _arrAlphabet[0] + _arrAlphabet[0];
|
firstFreeLetter,
|
||||||
for (var i = 1; arr.length < countButtons; i++) {
|
ind;
|
||||||
arr.push(_arrAlphabet[0] + _arrAlphabet[i]);
|
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;
|
return arr;
|
||||||
};
|
};
|
||||||
|
@ -209,6 +221,7 @@ Common.UI.HintManager = new(function() {
|
||||||
|
|
||||||
var _getControls = function() {
|
var _getControls = function() {
|
||||||
_currentControls = [];
|
_currentControls = [];
|
||||||
|
_usedTitles = [];
|
||||||
var arr = [],
|
var arr = [],
|
||||||
arrItemsWithTitle = [];
|
arrItemsWithTitle = [];
|
||||||
if (_.isArray(_currentSection)) {
|
if (_.isArray(_currentSection)) {
|
||||||
|
@ -249,6 +262,14 @@ Common.UI.HintManager = new(function() {
|
||||||
}
|
}
|
||||||
var _arrLetters = [];
|
var _arrLetters = [];
|
||||||
if (visibleItems.length > _arrAlphabet.length) {
|
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);
|
_arrLetters = _getLetters(visibleItems.length);
|
||||||
} else {
|
} else {
|
||||||
_arrLetters = _arrAlphabet.slice();
|
_arrLetters = _arrAlphabet.slice();
|
||||||
|
|
|
@ -142,7 +142,7 @@ define([
|
||||||
{caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'},
|
{caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'},
|
||||||
{caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'},
|
{caption: me.textTabInsert, action: 'ins', extcls: 'canedit', dataHintTitle: 'I'},
|
||||||
{caption: me.textTabTransitions, action: 'transit', extcls: 'canedit', dataHintTitle: 'N'},
|
{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,
|
undefined, undefined,
|
||||||
{caption: me.textTabView, action: 'view', extcls: 'canedit', layoutname: 'toolbar-view', dataHintTitle: 'W'}
|
{caption: me.textTabView, action: 'view', extcls: 'canedit', layoutname: 'toolbar-view', dataHintTitle: 'W'}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue