-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhealth.js
39 lines (36 loc) · 1.18 KB
/
health.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var Health = {};
Health.toggleDistributionGraph = function(event, graphBindingId1, graphBindingId2) {
var graph1 = ge('health_distribution_graph_' + graphBindingId1);
var graph2 = ge('health_distribution_graph_' + graphBindingId2);
if (isVisible(graph1)) {
show(graph2);
hide(graph1);
} else {
show(graph1);
hide(graph2);
}
}
Health.toggleSmallGraphs = function(event, graphType) {
var tabsWrap = event.target.parentNode.parentNode;
var selectedTab = geByClass1('selected', tabsWrap);
removeClass(selectedTab, 'selected');
addClass(event.target, 'selected');
nav.setLoc(event.target.getAttribute('href').replace(/^\//, ''));
if (graphType === 'count') {
each(geByTag('img', ge('health_small_graphs_count')), showImage);
show('health_small_graphs_count');
hide('health_small_graphs_time');
} else {
each(geByTag('img', ge('health_small_graphs_time')), showImage);
show('health_small_graphs_time');
hide('health_small_graphs_count');
}
function showImage(k, v) {
var src = v.getAttribute('src2');
if (src) {
v.removeAttribute('src2');
v.setAttribute('src', src);
}
}
}
try{stManager.done('health.js');}catch(e){}