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 for (var i = 0; i < s.length; i++) {
24 var h = window.innerHeight - a.getBoundingClientRect().top - 20;
25 height = String(h) + "px";
26 a.style['max-height'] = height;
30 $(window).on('load resize scroll', smart_scroll_fixup);