Restore the tabs scroll position when switching tab

issue10633
review336751002
This commit is contained in:
Cédric Krier committed 2021-08-12 18:47:54 +02:00
1 parent b23cbe25ee
commit 460fcaddde
1 file changed
+6
+6
View File
@@ -422,6 +422,12 @@
id: tab.id
}).append(tab.el)
.appendTo(tabcontent);
tab_link.on('hide.bs.tab', function(evt) {
jQuery(evt.target).data('scrollTop', tabs.scrollTop());
});
tab_link.on('shown.bs.tab', function(evt) {
tabs.scrollTop(jQuery(evt.target).data('scrollTop') || 0);
});
tab_link.tab('show');
tabs.trigger('ready');
};