aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/share.js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-04-03 22:02:05 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-04-03 22:02:05 +0200
commitbf7624fb255b7af534f5d6a740dd6dc9799cfc63 (patch)
tree8c61f56b8df1cd8118c92948a4432276efbfb4c3 /apps/files_sharing/js/share.js
parent388142ecc6a3b1382858619e0fea6145c506ab5e (diff)
parentd1e78d7a6b7ff074bb972e0840ca8cdfe2403000 (diff)
downloadnextcloud-server-bf7624fb255b7af534f5d6a740dd6dc9799cfc63.tar.gz
nextcloud-server-bf7624fb255b7af534f5d6a740dd6dc9799cfc63.zip
Merge pull request #6968 from owncloud/files-ajaxload
Ajaxify files list for files + trashbin + public page
Diffstat (limited to 'apps/files_sharing/js/share.js')
-rw-r--r--apps/files_sharing/js/share.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 9f0ed12f935..ea518f3b70e 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,15 +1,35 @@
+/*
+ * Copyright (c) 2014
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+/* global OC, t, FileList, FileActions */
$(document).ready(function() {
var disableSharing = $('#disableSharing').data('status'),
sharesLoaded = false;
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) {
+ var oldCreateRow = FileList._createRow;
+ FileList._createRow = function(fileData) {
+ var tr = oldCreateRow.apply(this, arguments);
+ if (fileData.shareOwner) {
+ tr.attr('data-share-owner', fileData.shareOwner);
+ }
+ return tr;
+ };
+
$('#fileList').on('fileActionsReady',function(){
- var allShared = $('#fileList').find('[data-share-owner]').find('[data-Action="Share"]');
+ var allShared = $('#fileList').find('[data-share-owner] [data-Action="Share"]');
allShared.addClass('permanent');
allShared.find('span').text(function(){
- $owner = $(this).closest('tr').attr('data-share-owner');
+ var $owner = $(this).closest('tr').attr('data-share-owner');
return ' ' + t('files_sharing', 'Shared by {owner}', {owner: $owner});
});