X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/549f4a1deddb41f6abbc493a660d9fb0976da91a..85c625c40ad873d0efac33f8a63c1ee256185e36:/apps/workbench/app/assets/javascripts/sizing.js diff --git a/apps/workbench/app/assets/javascripts/sizing.js b/apps/workbench/app/assets/javascripts/sizing.js index 3d60274439..569956fd3a 100644 --- a/apps/workbench/app/assets/javascripts/sizing.js +++ b/apps/workbench/app/assets/javascripts/sizing.js @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + function graph_zoom(divId, svgId, scale) { var pg = document.getElementById(divId); vcenter = (pg.scrollTop + (pg.scrollHeight - pg.scrollTopMax)/2.0) / pg.scrollHeight; @@ -20,10 +24,12 @@ function smart_scroll_fixup(s) { } s.each(function(i, a) { - var h = window.innerHeight - $(a).offset().top; + a = $(a); + var h = window.innerHeight - a.offset().top - a.attr("data-smart-scroll-padding-bottom"); height = String(h) + "px"; - $(a).css('max-height', height); + a.css('max-height', height); }); } $(window).on('load ready resize scroll ajax:complete', smart_scroll_fixup); +$(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);