Advertise filters param in discovery doc.
[arvados.git] / apps / workbench / app / assets / javascripts / sizing.js
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;
10     smart_scroll_fixup();
11 }
12
13 function smart_scroll_fixup(s) {
14     console.log(s);
15     if (s != null && s.type == 'shown.bs.tab') {
16         s = [s.target];
17     }
18     else {
19         s = $(".smart-scroll");
20     }
21     console.log(s);
22     for (var i = 0; i < s.length; i++) {
23         a = s[i];
24         var h = window.innerHeight - a.getBoundingClientRect().top - 20;
25         height = String(h) + "px";
26         a.style.height = height;
27     }
28 }
29
30 $(window).on('load resize scroll', smart_scroll_fixup);