bigbluebutton-Github/client/bbb-html5-client/public/js/router.coffee
2014-01-06 08:44:15 -08:00

31 lines
698 B
CoffeeScript

define [
'jquery',
'underscore',
'backbone',
'globals',
'cs!views/app',
'cs!views/login',
'cs!views/session'
], ($, _, Backbone, globals, AppView, LoginView, SessionView) ->
Router = Backbone.Router.extend
routes:
'session': 'showSession',
'login': 'showLogin',
# '*actions': 'defaultAction'
initialize: ->
@appView = new AppView()
showLogin: () ->
globals.router.navigate "/login", {replace: true}
@loginView ?= new LoginView()
@appView.render(@loginView)
showSession: () ->
globals.router.navigate "/session", {replace: true}
@sessionView ?= new SessionView()
@appView.render(@sessionView)
Router