From d0ba061f7a79119ec2b191772ce8f0ab14af22e5 Mon Sep 17 00:00:00 2001 From: Kristian Feldsam Date: Sun, 3 Sep 2023 18:35:24 +0200 Subject: [PATCH] [Web] mobile devices - scroll window to opened tab This feature was in versions before BS5 Signed-off-by: Kristian Feldsam --- data/web/js/build/013-mailcow.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/data/web/js/build/013-mailcow.js b/data/web/js/build/013-mailcow.js index 6291c8b4..ead4934e 100644 --- a/data/web/js/build/013-mailcow.js +++ b/data/web/js/build/013-mailcow.js @@ -125,6 +125,17 @@ $(document).ready(function() { } }); })(); + + // responsive tabs, scroll to opened tab + $(document).on("shown.bs.collapse shown.bs.tab", function (e) { + var target = $(e.target); + if($(window).width() <= 767) { + var offset = target.offset().top - 60; + $("html, body").stop().animate({ + scrollTop: offset + }, 100); + } + }); // IE fix to hide scrollbars when table body is empty $('tbody').filter(function (index) {