Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen van Bergerem <svbergerem@online.de>2016-08-30 17:34:06 +0300
committerDennis Schubert <mail@dennis-schubert.de>2016-09-04 04:17:48 +0300
commit9a2cb1517a9f35f700f50a3870287b55bf97f87d (patch)
treea39a1cd3b19dd9b9aa84a0f3a3d384a63aeceda3 /app/assets
parent02742a4a8fc38be7e22614d10dde575f4e22d4f4 (diff)
Set participations client side when changing post interactions
closes #7040
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/app/models/post/interactions.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/app/models/post/interactions.js b/app/assets/javascripts/app/models/post/interactions.js
index e837f96bc..28d6f3a57 100644
--- a/app/assets/javascripts/app/models/post/interactions.js
+++ b/app/assets/javascripts/app/models/post/interactions.js
@@ -67,6 +67,7 @@ app.models.Post.Interactions = Backbone.Model.extend({
var self = this;
this.likes.create({}, {
success: function() {
+ self.post.set({participation: true});
self.trigger("change");
self.set({"likes_count" : self.get("likes_count") + 1});
},
@@ -94,6 +95,7 @@ app.models.Post.Interactions = Backbone.Model.extend({
this.comments.make(text).fail(function () {
app.flashMessages.error(Diaspora.I18n.t("failed_to_comment"));
}).done(function() {
+ self.post.set({participation: true});
self.trigger('change'); //updates after sync
});
@@ -109,6 +111,7 @@ app.models.Post.Interactions = Backbone.Model.extend({
.done(function(reshare) {
app.flashMessages.success(Diaspora.I18n.t("reshares.successful"));
interactions.reshares.add(reshare);
+ interactions.post.set({participation: true});
if (app.stream && /^\/(?:stream|activity|aspects)/.test(app.stream.basePath())) {
app.stream.addNow(reshare);
}