first routes added

This commit is contained in:
Hendrik Fellerhoff 2012-03-23 02:57:42 +01:00
parent d6b7f80c93
commit b11e96dc64
1 changed files with 19 additions and 6 deletions

View File

@ -5,13 +5,26 @@
* Time: 00:51
* Main Javascript file
*/
var rooms;
var volumes = {"room1":0,"room2":0,"room3":0,"room4":0};
var devices;
Workspace = Backbone.Router.extend({
routes:{
"":"home",
":id":"show_room"
},
home: function() {
rooms.fetch();
},
show_room: function(id) {
this.home();
window.roomTabsId = id;
}
});
$(document).ready(function() {
var rooms = new Rooms();
var roomsView = new RoomsView({collection: rooms});
rooms.fetch();
window.rooms = new Rooms();
window.roomsView = new RoomsView({collection: rooms});
window.App = new Workspace();
Backbone.history.start()
});