164:b6b5babb4898 default tip
Anton Shestakov <av6@dwimlabs.net>, Tue, 31 Oct 2017 16:50:46 +0800
Added tag 0.5.0 for changeset 9ed8b453c537

previous change 147:af2c69b87882

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.$('[data-workspace]').removeClass('active');
this.$('[data-workspace="' + workspace + '"]').addClass('active');
}
});