aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/js/filesplugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/js/filesplugin.js')
-rw-r--r--apps/comments/js/filesplugin.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/comments/js/filesplugin.js b/apps/comments/js/filesplugin.js
index cc419c18ddb..8c5762065a1 100644
--- a/apps/comments/js/filesplugin.js
+++ b/apps/comments/js/filesplugin.js
@@ -11,6 +11,11 @@
/* global Handlebars */
(function() {
+
+ _.extend(OC.Files.Client, {
+ PROPERTY_COMMENTS_UNREAD: '{' + OC.Files.Client.NS_OWNCLOUD + '}comments-unread'
+ });
+
var TEMPLATE_COMMENTS_UNREAD =
'<a class="action action-comment permanent" title="{{countMessage}}" href="#">' +
'<img class="svg" src="{{iconUrl}}"/>' +
@@ -52,19 +57,17 @@
fileList.registerTabView(new OCA.Comments.CommentsTabView('commentsTabView'));
- var NS_OC = 'http://owncloud.org/ns';
-
var oldGetWebdavProperties = fileList._getWebdavProperties;
fileList._getWebdavProperties = function() {
var props = oldGetWebdavProperties.apply(this, arguments);
- props.push('{' + NS_OC + '}comments-unread');
+ props.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD);
return props;
};
fileList.filesClient.addFileInfoParser(function(response) {
var data = {};
var props = response.propStat[0].properties;
- var commentsUnread = props['{' + NS_OC + '}comments-unread'];
+ var commentsUnread = props[OC.Files.Client.PROPERTY_COMMENTS_UNREAD];
if (!_.isUndefined(commentsUnread) && commentsUnread !== '') {
data.commentsUnread = parseInt(commentsUnread, 10);
}