bunti-node/js/modules/router.js

32 lines
833 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) {
2012-07-19 21:45:22 +00:00
// Dependencies
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);
2012-07-19 21:45:22 +00:00
jscolor.init();
}
});
})(app.module("router"));