1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00
This commit is contained in:
zhengxie
2015-01-21 22:22:34 +08:00
committed by Daniel Pan
parent 92be0754bd
commit 26e26ac22d
12 changed files with 361 additions and 115 deletions

View File

@@ -0,0 +1,47 @@
define([
'jquery',
'underscore',
'backbone',
'text!' + app.config._tmplRoot + 'group-repos.html'
], function($, _, Backbone, reposTemplate) {
'use strict';
var GroupRepoView = Backbone.View.extend({
tagName: 'tr',
template: _.template(reposTemplate),
events: {
'mouseenter': 'showAction',
'mouseleave': 'hideAction',
'click .cancel-share': 'unshare'
},
initialize: function() {
console.log('init GroupRepoView');
Backbone.View.prototype.initialize.apply(this, arguments);
},
render: function() {
this.$el.html(this.template(this.model.toJSON()));
return this;
},
showAction: function() {
this.$el.addClass('hl');
this.$el.find('.op-icon').removeClass('vh');
},
hideAction: function() {
this.$el.removeClass('hl');
this.$el.find('.op-icon').addClass('vh');
},
unshare: function() {
this.model.destroy();
}
});
return GroupRepoView;
});