1 function graph_zoom(divId, svgId, scale) {
2 var pg = document.getElementById(divId);
3 vcenter = (pg.scrollTop + (pg.scrollHeight - pg.scrollTopMax)/2.0) / pg.scrollHeight;
4 hcenter = (pg.scrollLeft + (pg.scrollWidth - pg.scrollLeftMax)/2.0) / pg.scrollWidth;
5 var g = document.getElementById(svgId);
6 g.setAttribute("height", parseFloat(g.getAttribute("height")) * scale);
7 g.setAttribute("width", parseFloat(g.getAttribute("width")) * scale);
8 pg.scrollTop = (vcenter * pg.scrollHeight) - (pg.scrollHeight - pg.scrollTopMax)/2.0;
9 pg.scrollLeft = (hcenter * pg.scrollWidth) - (pg.scrollWidth - pg.scrollLeftMax)/2.0;
13 function smart_scroll_fixup(s) {
15 if (s != null && s.type == 'shown.bs.tab') {
19 s = $(".smart-scroll");
22 s.each(function(i, a) {
24 var h = window.innerHeight - a.offset().top - a.attr("data-smart-scroll-padding-bottom");
25 height = String(h) + "px";
26 a.css('max-height', height);
30 $(window).on('load ready resize scroll ajax:complete', smart_scroll_fixup);
31 $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);