Merge pull request #5355 from GogoVega/improve-next-previous-tab-action

Allow actions show-next-tab and previous to loop
pull/5401/head^2
Nick O'Leary 2026-01-05 17:38:32 +00:00 committed by GitHub
commit 92ca0eea83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 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"));
}