1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

Add group discussion delete

This commit is contained in:
Daniel Pan
2016-03-18 11:21:26 +08:00
committed by llj
parent 077a2627f0
commit 26d25c6448
6 changed files with 43 additions and 8 deletions

View File

@@ -10,16 +10,18 @@ define([
var View = Backbone.View.extend({
tagName: 'li',
className: 'msg cspt ovhd',
className: 'msg ovhd',
template: _.template($('#group-discussion-tmpl').html()),
events: {
'mouseenter': 'highlight',
'mouseleave': 'rmHighlight'
'mouseleave': 'rmHighlight',
'click .js-del-msg': 'delMessage'
},
initialize: function() {
this.listenTo(this.model, 'destroy', this.remove);
},
render: function() {
@@ -46,6 +48,23 @@ define([
rmHighlight: function() {
this.$el.removeClass('hl');
},
delMessage: function() {
this.model.destroy({
wait: true,
success: function() {
},
error: function(model, response) {
var err;
if (response.responseText) {
err = $.parseJSON(response.responseText).error_msg;
} else {
err = gettext("Failed. Please check the network.");
}
Common.feedback(err, 'error');
}
});
}
});