first routes added
This commit is contained in:
parent
d6b7f80c93
commit
b11e96dc64
|
@ -5,13 +5,26 @@
|
||||||
* Time: 00:51
|
* Time: 00:51
|
||||||
* Main Javascript file
|
* 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() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
var rooms = new Rooms();
|
window.rooms = new Rooms();
|
||||||
var roomsView = new RoomsView({collection: rooms});
|
window.roomsView = new RoomsView({collection: rooms});
|
||||||
rooms.fetch();
|
|
||||||
|
window.App = new Workspace();
|
||||||
|
Backbone.history.start()
|
||||||
});
|
});
|
Loading…
Reference in New Issue