Show/update post edits count and icon after editing a post

This commit is contained in:
Neil Lalonde 2013-07-10 15:15:13 -04:00
parent 0e3e5bf533
commit cdf0754626
1 changed files with 2 additions and 0 deletions

View File

@ -131,6 +131,7 @@ Discourse.Post = Discourse.Model.extend({
// Save a post and call the callback when done.
save: function(complete, error) {
var self = this;
if (!this.get('newPost')) {
// We're updating a post
return Discourse.ajax("/posts/" + (this.get('id')), {
@ -141,6 +142,7 @@ Discourse.Post = Discourse.Model.extend({
}
}).then(function(result) {
// If we received a category update, update it
self.set('version', result.post.version);
if (result.category) Discourse.Site.instance().updateCategory(result.category);
if (complete) complete(Discourse.Post.create(result.post));
}, function(result) {