summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/router.js
blob: 30646c1bbacf9535b109c0049ab8bd68a03ef58c (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
var lobby, room

var SiteRouter = Router.extend({

	el: "body",
	
	routes: {
		"/":            'lobby',
		"/index":       'index',
		"/login":       'login',
		"/details/:id": 'room',
	},
	
	initialize: function(){
		if (! user.username) {
		  app.view = new LoginView()
		}
		else {
      this.route()
    }
  },
  
  index: function(){
    app.view = new IndexView ()
  },
  
  login: function(){
    app.view = new LoginView ()
  },

})