-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
75 lines (66 loc) · 2.03 KB
/
main.js
File metadata and controls
75 lines (66 loc) · 2.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*==================== MENU SHOW Y HIDDEN ====================*/
const navMenu = document.getElementById('nav-menu'),
navToggle = document.getElementById('nav-toggle'),
navClose = document.getElementById('nav-close')
/*===== MENU SHOW =====*/
/* Validate if constant exists */
if(navToggle){
navToggle.addEventListener('click', () =>{
navMenu.classList.add('show-menu')
})
}
/*===== MENU HIDDEN =====*/
/* Validate if constant exists */
if(navClose){
navClose.addEventListener('click', () =>{
navMenu.classList.remove('show-menu')
})
}
/*==================== REMOVE MENU MOBILE ====================*/
const navLink = document.querySelectorAll('.nav__link')
function linkAction(){
const navMenu = document.getElementById('nav-menu')
// When we click on each nav__link, we remove the show-menu class
navMenu.classList.remove('show-menu')
}
navLink.forEach(n => n.addEventListener('click', linkAction))
/*==================== PUBLICATIONS ====================*/
// from: http://www.robots.ox.ac.uk/~vedaldi/assets/hidebib.js
function hideallbibs()
{
var el = document.getElementsByTagName("div") ;
for (var i = 0 ; i < el.length ; ++i) {
if (el[i].className == "paper") {
var bib = el[i].getElementsByTagName("pre") ;
if (bib.length > 0) {
bib [0] .style.display = 'none' ;
}
}
}
}
function togglebib(paperid)
{
var paper = document.getElementById(paperid) ;
var bib = paper.getElementsByTagName('pre') ;
if (bib.length > 0) {
if (bib [0] .style.display == 'none') {
bib [0] .style.display = 'block' ;
} else {
bib [0] .style.display = 'none' ;
}
}
}
function toggleblock(blockId)
{
var block = document.getElementById(blockId);
if (block.style.display == 'none') {
block.style.display = 'block' ;
} else {
block.style.display = 'none' ;
}
}
function hideblock(blockId)
{
var block = document.getElementById(blockId);
block.style.display = 'none' ;
}