changeset dc9b2509ddad in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=dc9b2509ddad
description:
Loop over tabs when reaching end
issue8071
review47781002
diffstat:
src/tab.js | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (17 lines):
diff -r 1fb660f08f6d -r dc9b2509ddad src/tab.js
--- a/src/tab.js Sun Feb 10 13:42:16 2019 +0100
+++ b/src/tab.js Sun Feb 10 22:54:30 2019 +0100
@@ -466,6 +466,13 @@
var tablist = jQuery('#tablist');
var tab = tablist.find('#nav-' + current_tab.id);
var next = tab[direction]('li').first();
+ if (!next.length) {
+ if (direction == 'prevAll') {
+ next = tablist.find('li').last();
+ } else {
+ next = tablist.find('li').first();
+ }
+ }
if (next) {
next.find('a').tab('show');
tabs.trigger('ready');