forked from barryclark/jekyll-now
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpander.js
More file actions
25 lines (22 loc) · 1.03 KB
/
expander.js
File metadata and controls
25 lines (22 loc) · 1.03 KB
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
// I know that technically I could make this into a verbose library that
// handles tons of cases, but I honestly don't see the need when it's good
// enough like this.
var invisible = 'invisible';
var infoBox = 'infoBox';
var expandoInfoBox = function (basicInfo, detailedInfo) {
document.getElementById(basicInfo).classList.add(invisible);
document.getElementById(detailedInfo).classList.remove(invisible);
};
var closeoInfoBox = function (basicInfo, detailedInfo) {
document.getElementById(basicInfo).classList.remove(invisible);
document.getElementById(detailedInfo).classList.add(invisible);
};
var expandoLink = function (detailedInfo) {
if (document.getElementById(detailedInfo).classList.contains(invisible)) {
document.getElementById(detailedInfo).classList.remove(invisible);
document.getElementById(detailedInfo).classList.add(infoBox);
} else {
document.getElementById(detailedInfo).classList.add(invisible);
document.getElementById(detailedInfo).classList.remove(infoBox);
}
};