1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +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,16 +2,18 @@ define([
'jquery',
'underscore',
'backbone',
'common'
], function($, _, Backbone, Common) {
'common',
'app/views/widgets/hl-item-view'
], function($, _, Backbone, Common, HLItemView) {
'use strict';
var OrganizationRepoView = Backbone.View.extend({
var OrganizationRepoView = HLItemView.extend({
tagName: 'tr',
template: _.template($('#organization-repo-tmpl').html()),
initialize: function() {
HLItemView.prototype.initialize.call(this);
},
render: function() {
@@ -27,19 +29,9 @@ define([
},
events: {
'mouseenter': 'highlight',
'mouseleave': 'rmHighlight',
'click .cancel-share': 'removeShare'
},
highlight: function() {
this.$el.addClass('hl').find('.op-icon').removeClass('vh');
},
rmHighlight: function() {
this.$el.removeClass('hl').find('.op-icon').addClass('vh');
},
removeShare: function() {
var el = this.$el;
var lib_name = this.model.get('name');