currentSection = 0;
}
let loop = 0;
- while (!this.tabNavigation(selectors[currentSection], dir, false)) {
+ while (!this.tabNavigation(selectors[currentSection], dir, false, loop > 0)) {
currentSection += dir;
if (currentSection >= selectors.length || currentSection < 0) {
return false;
return true;
},
- tabNavigation: function (selector, dir, loop) {
+ tabNavigation: function (selector, dir, loop, switchList) {
+ if (switchList === undefined) {
+ switchList = false;
+ }
if (loop === undefined) {
loop = true;
}
console.log(selector, 'nothing here');
return false;
}
- let res = this._navigate(list, dir, ['focus'], loop);
+ let res = this._navigate(list, dir, ['focus'], loop, switchList);
if (!res) {
console.log(selector, 'end of list');
}
return res;
},
- _navigate: function (list, dir, actions, loop) {
+ _navigate: function (list, dir, actions, loop, switchList) {
+ if (switchList === undefined) {
+ switchList = false;
+ }
if (loop === undefined) {
loop = true;
}
next = (nb + index + dir) % nb;
} else {
next = index + dir;
+ if (switchList && next === -2) {
+ next = nb - 1;
+ }
if (next >= nb || next < 0) {
return false;
}
},
displayTooltip: function (text, style, css) {
- console.log('displayTooltip', text, style, css);
if (text === '-') {
return this.hideTooltip('before displayTooltip');
}
},
hideTooltip: function (where) {
- console.log('hide tooltip', where);
+ //console.log('hide tooltip', where);
$("#tooltip").hide().text('');
},