blob: f3dd97d69d9957433a2ff5a0d99f6487faa32dcc (
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
49
50
51
|
var NavView = View.extend({
el: ".menu",
events: {
"click li": "click",
},
initialize: function(){
},
click: function(e){
var id = $(e.target).data("id")
this.pick(id)
},
pick: function(id){
var view = app.lookup[ id ]
this.swap( view )
},
previous: function(){
var index = Math.max( app.view.page_number - 1, 0 )
var view = app.projects[ index ]
this.swap( view )
},
next: function(){
var index = Math.min( app.view.page_number + 1, app.projects.length - 1 )
var view = app.projects[ index ]
this.swap( view )
},
swap: function(view) {
if (view && ! app.view) {
app.view = view
app.view.show()
return
}
if (! view || app.view == view || app.view.showing) {
return
}
console.log(view.page_number, view.project_id)
app.view.hide()
view.show()
app.view = view
},
})
|