blob: 7efac5090fd225f7a2c3705e4cdf166b34b7780f (
plain)
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
|
var HeaderView = View.extend({
el: "nav",
events: {
"click .index": "toggleNav",
},
initialize: function(){
this.$figText = this.$(".fig-text")
this.$pageNumber = this.$(".page-no")
this.$slideNumber = this.$(".slide-no")
this.$slideCount = this.$(".slide-count")
this.$time = this.$("#time")
this.$hours = this.$("#hours")
this.$minutes = this.$("#minutes")
$("#curtain").click(this.toggleNav)
},
updateSlideNumber: function(n){
n += 1
if (n < 10) n = "0" + n
this.$slideNumber.html(n)
},
updatePageNumber: function(n){
n += 1
if (n < 10) n = "0" + n
this.$pageNumber.html(n)
},
updateSlideCount: function(n){
if (n > 1) {
if (n < 10) n = "0" + n
this.$figText.show()
this.$slideCount.html(n)
}
else {
this.$figText.hide()
}
},
toggleNav: function(){
document.body.classList.toggle('navopen') // $('body').toggleClass('navopen')
},
})
|