In single post view deleting a comment updates the counter
This commit is contained in:
parent
2aaf37659d
commit
d0eb711ca0
3 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
## Refactor
|
## Refactor
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
* Update comment counter when weleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
|
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,10 @@ app.models.Post.Interactions = Backbone.Model.extend({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
removedComment: function() {
|
||||||
|
this.set({"comments_count": this.get("comments_count") - 1});
|
||||||
|
},
|
||||||
|
|
||||||
reshare : function(){
|
reshare : function(){
|
||||||
var interactions = this;
|
var interactions = this;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,10 @@ app.views.CommentStream = app.views.Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
removeComment: function(comment) {
|
removeComment: function(comment) {
|
||||||
this.$("#" + comment.get("guid")).closest(".comment.media").remove();
|
var result = this.$("#" + comment.get("guid")).closest(".comment.media").remove();
|
||||||
|
if (result.hasClass("deleting")) {
|
||||||
|
this.model.interactions.removedComment();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
expandComments: function(evt){
|
expandComments: function(evt){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue