1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

Rewrite repo with HLItemView

This commit is contained in:
Daniel Pan
2016-03-22 11:47:52 +08:00
parent 6254417be8
commit 2e5ced905f
6 changed files with 38 additions and 66 deletions

View File

@@ -2,22 +2,22 @@ define([
'jquery',
'underscore',
'backbone',
'common'
], function($, _, Backbone, Common) {
'common',
'app/views/widgets/hl-item-view'
], function($, _, Backbone, Common, HLItemView) {
'use strict';
var SharedRepoView = Backbone.View.extend({
var SharedRepoView = HLItemView.extend({
tagName: 'tr',
template: _.template($('#shared-repo-tmpl').html()),
events: {
'mouseenter': 'showAction',
'mouseleave': 'hideAction',
'click .unshare-btn': 'removeShare'
},
initialize: function() {
HLItemView.prototype.initialize.call(this);
},
removeShare: function(e) {
@@ -56,17 +56,8 @@ define([
});
this.$el.html(this.template(obj));
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');
}
});
return SharedRepoView;