diff --git a/js/controller/ActivityController.js b/js/controller/ActivityController.js index 04390c152..1a13f625f 100644 --- a/js/controller/ActivityController.js +++ b/js/controller/ActivityController.js @@ -208,10 +208,10 @@ class ActivityController { } updateComment(item) { - let message = this.formatMessage(item); - item.commentEdit = message; + item.commentEdit = this.formatMessage(item); let $target = $('.newCommentForm .message'); this.applyAtWho($target); + /** Workaround to trigger avatar rendering after the view has been updated */ window.setTimeout(function () { $target.find('.avatar').avatar(undefined, 16); }, 0); diff --git a/js/legacy/commentmodel.js b/js/legacy/commentmodel.js index bf3245ab7..1cf5c6bc3 100644 --- a/js/legacy/commentmodel.js +++ b/js/legacy/commentmodel.js @@ -99,10 +99,18 @@ var CommentModel = OC.Backbone.Model.extend( }, url: function() { - if (typeof this.get('id') !== 'undefined') { - return this.collection.url() + this.get('id'); + let baseUrl; + if (typeof this.collection === 'undefined') { + baseUrl = OC.linkToRemote('dav') + '/comments/' + + encodeURIComponent(this.get('objectType')) + '/' + + encodeURIComponent(this.get('objectId')) + '/'; } else { - return this.collection.url(); + baseUrl = this.collection.url(); + } + if (typeof this.get('id') !== 'undefined') { + return baseUrl + this.get('id'); + } else { + return baseUrl; } } }); diff --git a/js/service/ActivityService.js b/js/service/ActivityService.js index 2b5859f36..3e2a4d3da 100644 --- a/js/service/ActivityService.js +++ b/js/service/ActivityService.js @@ -223,7 +223,6 @@ class ActivityService { loadComments(id) { this.commentCollection.reset(); this.commentCollection.setObjectId(id); - this.commentCollection.fetchNext(); } }