// 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) { // 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); jscolor.init(); } }); })(app.module("router"));