44:26cb6352ac2c
Anton Shestakov <engored@ya.ru>, Fri, 08 Nov 2013 09:39:11 +0000
Build status icon

next change 147:af2c69b87882
previous change 43:d1ff547fa61d

static/js/framework/views/workspaces.js

Permissions: -rw-r--r--

Other formats: Feeds:
var WorkspaceTabsView = CollectionView.extend({
initialize: function(options) {
this.compileTemplates(options.templates);
this.bindCollection();
},
clear: function() {
this.$el.empty();
},
renderItem: function(workspace) {
return $(this.templates.tab(workspace.toJSON()));
},
appendItem: function(workspace) {
var $item = this.renderItem(workspace);
this.$el.append($item);
},
activate: function(workspace) {
this.$el.find('[data-workspace]').removeClass('active');
this.$el.find('[data-workspace="' + workspace + '"]').addClass('active');
}
});