Fix issue when switching between cards
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -208,10 +208,10 @@ class ActivityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateComment(item) {
|
updateComment(item) {
|
||||||
let message = this.formatMessage(item);
|
item.commentEdit = this.formatMessage(item);
|
||||||
item.commentEdit = message;
|
|
||||||
let $target = $('.newCommentForm .message');
|
let $target = $('.newCommentForm .message');
|
||||||
this.applyAtWho($target);
|
this.applyAtWho($target);
|
||||||
|
/** Workaround to trigger avatar rendering after the view has been updated */
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
$target.find('.avatar').avatar(undefined, 16);
|
$target.find('.avatar').avatar(undefined, 16);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|||||||
@@ -99,10 +99,18 @@ var CommentModel = OC.Backbone.Model.extend(
|
|||||||
},
|
},
|
||||||
|
|
||||||
url: function() {
|
url: function() {
|
||||||
if (typeof this.get('id') !== 'undefined') {
|
let baseUrl;
|
||||||
return this.collection.url() + this.get('id');
|
if (typeof this.collection === 'undefined') {
|
||||||
|
baseUrl = OC.linkToRemote('dav') + '/comments/' +
|
||||||
|
encodeURIComponent(this.get('objectType')) + '/' +
|
||||||
|
encodeURIComponent(this.get('objectId')) + '/';
|
||||||
} else {
|
} else {
|
||||||
return this.collection.url();
|
baseUrl = this.collection.url();
|
||||||
|
}
|
||||||
|
if (typeof this.get('id') !== 'undefined') {
|
||||||
|
return baseUrl + this.get('id');
|
||||||
|
} else {
|
||||||
|
return baseUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -223,7 +223,6 @@ class ActivityService {
|
|||||||
loadComments(id) {
|
loadComments(id) {
|
||||||
this.commentCollection.reset();
|
this.commentCollection.reset();
|
||||||
this.commentCollection.setObjectId(id);
|
this.commentCollection.setObjectId(id);
|
||||||
this.commentCollection.fetchNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user