2012-07-19 14:25:01 +00:00
|
|
|
|
// 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
|
2012-07-19 14:25:01 +00:00
|
|
|
|
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();
|
2012-07-19 14:25:01 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})(app.module("router"));
|