mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-24 21:07:17 +00:00
tmp mod
This commit is contained in:
47
media/scripts/app/views/group-repos.js
Normal file
47
media/scripts/app/views/group-repos.js
Normal 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;
|
||||
});
|
Reference in New Issue
Block a user