Move the logic to the right place

pull/5355/head
GogoVega 2025-12-07 12:04:59 +01:00
parent 49b85e3f73
commit 2c7a15ecb2
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B
1 changed files with 6 additions and 6 deletions

View File

@ -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) {