1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-27 23:48:48 +00:00
seahub/static/scripts/app/views/activity-item.js
2015-07-28 19:55:05 +08:00

41 lines
900 B
JavaScript

define([
'jquery',
'underscore',
'backbone',
'common',
'app/views/details'
], function($, _, Backbone, Common, DetailesView) {
'use strict';
var ActivityItem = Backbone.View.extend({
tagName: 'li',
className: 'event-item',
template: _.template($('#activity-item-tmpl').html()),
events: {
'click .lsch': 'showDetails'
},
initialize: function(activity) {
this.activity = activity;
},
showDetails: function () {
var options = {
'repo_id': this.activity.repo_id,
'cmmt_id': this.activity.commit_id
};
new DetailesView(options);
},
render: function () {
this.$el.html(this.template({'activity': this.activity}));
return this;
}
});
return ActivityItem;
});