bunti-node/js/modules/router.js

30 lines
794 B
JavaScript
Raw Normal View History

// js/router.js
// Module reference argument, assigned at the bottom
// every device gets its model from the base and is rendered into seperate viewbases
(function (Router) {
var Dashboard = app.module("dashboard");
Router.Router = Backbone.Router.extend({
routes: {
"room/:id": "roomDetails",
"": "home"
},
initialize: function () {
if (!this.dashboard) {
this.dashboard = new Dashboard.View();
}
},
home: function () {
$('#content').html('');
//this.dashboard.render();
},
roomDetails: function (roomId) {
this.dashboard.renderRoomWithId(roomId);
}
});
})(app.module("router"));