mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 08:53:14 +00:00
Add reply action
This commit is contained in:
@@ -986,7 +986,7 @@
|
|||||||
<div class="msg-body">
|
<div class="msg-body">
|
||||||
<div class="msg-header">
|
<div class="msg-header">
|
||||||
<div class="msg-ops">
|
<div class="msg-ops">
|
||||||
<span class="msg-op js-rep-msg">{% trans "Reply" %}</span>
|
<span class="msg-op js-reply-msg">{% trans "Reply" %}</span>
|
||||||
<span class="msg-op js-del-msg">{% trans "Delete" %}</span>
|
<span class="msg-op js-del-msg">{% trans "Delete" %}</span>
|
||||||
</div>
|
</div>
|
||||||
<a class="msg-username ellipsis" href="<%= user_profile_url %>"><%- user_name %></a>
|
<a class="msg-username ellipsis" href="<%= user_profile_url %>"><%- user_name %></a>
|
||||||
|
@@ -17,11 +17,13 @@ define([
|
|||||||
events: {
|
events: {
|
||||||
'mouseenter': 'highlight',
|
'mouseenter': 'highlight',
|
||||||
'mouseleave': 'rmHighlight',
|
'mouseleave': 'rmHighlight',
|
||||||
'click .js-del-msg': 'delMessage'
|
'click .js-del-msg': 'delMessage',
|
||||||
|
'click .js-reply-msg': 'reply'
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function(options) {
|
||||||
this.listenTo(this.model, 'destroy', this.remove);
|
this.listenTo(this.model, 'destroy', this.remove);
|
||||||
|
this.parentView = options.parentView;
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
@@ -50,6 +52,10 @@ define([
|
|||||||
this.$el.removeClass('hl');
|
this.$el.removeClass('hl');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
reply: function() {
|
||||||
|
this.parentView.beginReply(this.model.get("user_name"));
|
||||||
|
},
|
||||||
|
|
||||||
delMessage: function() {
|
delMessage: function() {
|
||||||
this.model.destroy({
|
this.model.destroy({
|
||||||
wait: true,
|
wait: true,
|
||||||
|
@@ -47,7 +47,8 @@ define([
|
|||||||
|
|
||||||
addOne: function(item, collection, options) {
|
addOne: function(item, collection, options) {
|
||||||
var view = new ItemView({
|
var view = new ItemView({
|
||||||
model: item
|
model: item,
|
||||||
|
parentView: this
|
||||||
});
|
});
|
||||||
if (options.prepend == true) {
|
if (options.prepend == true) {
|
||||||
this.$listContainer.append(view.render().el);
|
this.$listContainer.append(view.render().el);
|
||||||
@@ -117,6 +118,10 @@ define([
|
|||||||
app.router.navigate('group/' + this.group_id + '/');
|
app.router.navigate('group/' + this.group_id + '/');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
beginReply: function(to_user) {
|
||||||
|
this.$('[name="message"]').val("@" + to_user + " ");
|
||||||
|
},
|
||||||
|
|
||||||
formSubmit: function() {
|
formSubmit: function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var content = $.trim(this.$('[name="message"]').val());
|
var content = $.trim(this.$('[name="message"]').val());
|
||||||
|
Reference in New Issue
Block a user