Sfoglia il codice sorgente

[Web] mobile devices - scroll window to opened tab

This feature was in versions before BS5

Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
Kristian Feldsam 2 anni fa
parent
commit
d0ba061f7a
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      data/web/js/build/013-mailcow.js

+ 11 - 0
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
   // IE fix to hide scrollbars when table body is empty
   $('tbody').filter(function (index) {
   $('tbody').filter(function (index) {