views.js wasn't added to git - dunno why ;D

This commit is contained in:
Hendrik Fellerhoff 2012-03-23 02:59:58 +01:00
parent b11e96dc64
commit 4e26793524
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
window.RoomsView = Backbone.View.extend({
initialize: function() {
this.collection.bind('reset', this.render, this);
},
render: function() {
this.template = Handlebars.compile($("#room-tabs-template").html());
var rooms = {'rooms': this.collection.toJSON()};
$('#room-tabs').html(this.template(rooms)).tabs();
if(typeof(window.roomTabsId) != "undefined") {
$('#room-tabs').tabs('select', window.roomTabsId);
}
return this;
}
});