diff --git a/src/main/webapp/resources/js/views.js b/src/main/webapp/resources/js/views.js new file mode 100644 index 0000000..ce01f0b --- /dev/null +++ b/src/main/webapp/resources/js/views.js @@ -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; + } +});