Fix issue when switching between cards

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-10-08 18:05:41 +02:00
parent 9363f8667c
commit 5f8c46b146
3 changed files with 13 additions and 6 deletions

View File

@@ -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;
}
}
});