mirror of https://github.com/node-red/node-red.git
Move the logic to the right place
parent
49b85e3f73
commit
2c7a15ecb2
|
|
@ -443,12 +443,18 @@ RED.tabs = (function() {
|
|||
}
|
||||
function activatePreviousTab() {
|
||||
var previous = findPreviousVisibleTab();
|
||||
if (previous.length === 0) {
|
||||
previous = ul.find("li.red-ui-tab:not(.hide-tab)").last();
|
||||
}
|
||||
if (previous.length > 0) {
|
||||
activateTab(previous.find("a"));
|
||||
}
|
||||
}
|
||||
function activateNextTab() {
|
||||
var next = findNextVisibleTab();
|
||||
if (next.length === 0) {
|
||||
next = ul.find("li.red-ui-tab:not(.hide-tab)").first();
|
||||
}
|
||||
if (next.length > 0) {
|
||||
activateTab(next.find("a"));
|
||||
}
|
||||
|
|
@ -607,9 +613,6 @@ RED.tabs = (function() {
|
|||
while(previous.length > 0 && previous.hasClass("hide-tab")) {
|
||||
previous = previous.prev();
|
||||
}
|
||||
if (previous.length === 0) {
|
||||
previous = ul.find("li.red-ui-tab:not(.hide-tab)").last();
|
||||
}
|
||||
return previous;
|
||||
}
|
||||
function findNextVisibleTab(li) {
|
||||
|
|
@ -620,9 +623,6 @@ RED.tabs = (function() {
|
|||
while(next.length > 0 && next.hasClass("hide-tab")) {
|
||||
next = next.next();
|
||||
}
|
||||
if (next.length === 0) {
|
||||
next = ul.find("li.red-ui-tab:not(.hide-tab)").first();
|
||||
}
|
||||
return next;
|
||||
}
|
||||
function showTab(id) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue