1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 17:33:18 +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,23 @@ define([
'jquery',
'underscore',
'backbone',
'common'
], function($, _, Backbone, Common) {
'common',
'app/views/widgets/hl-item-view'
], function($, _, Backbone, Common, HLItemView) {
'use strict';
var GroupRepoView = Backbone.View.extend({
var GroupRepoView = HLItemView.extend({
tagName: 'tr',
template: _.template($('#group-repo-tmpl').html()),
events: {
'mouseenter': 'highlight',
'mouseleave': 'rmHighlight',
'click .cancel-share': 'unshare'
},
initialize: function(options) {
HLItemView.prototype.initialize.call(this);
this.group_id = options.group_id;
this.is_staff = options.is_staff;
@@ -48,14 +49,6 @@ define([
return this;
},
highlight: function() {
this.$el.addClass('hl').find('.op-icon').removeClass('vh');
},
rmHighlight: function() {
this.$el.removeClass('hl').find('.op-icon').addClass('vh');
},
unshare: function() {
var lib_name = this.model.get('name');
this.model.destroy({