summaryrefslogtreecommitdiffstats
path: root/core/js/share.js
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-01-26 13:25:15 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-01-26 13:25:15 -0500
commit31ebea0f6a9f6e26068b819d7d5989bf42a518af (patch)
treeb9d60aa7c634cae26e5c17f56b87280ba8ffb7c3 /core/js/share.js
parentc9e25d3fab17b178759dd6d2f9488aa4cf37fbbb (diff)
downloadnextcloud-server-31ebea0f6a9f6e26068b819d7d5989bf42a518af.tar.gz
nextcloud-server-31ebea0f6a9f6e26068b819d7d5989bf42a518af.zip
Permanently display shared status icons
Diffstat (limited to 'core/js/share.js')
-rw-r--r--core/js/share.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/js/share.js b/core/js/share.js
index bb3ec010ff5..d404b910e48 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -23,7 +23,9 @@ OC.Share={
} else {
var file = $('tr').filterAttr('data-file', OC.basename(item));
if (file.length > 0) {
- $(file).find('.fileactions .action').filterAttr('data-action', 'Share').find('img').attr('src', image);
+ var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share');
+ action.find('img').attr('src', image);
+ action.addClass('permanent');
}
var dir = $('#dir').val();
if (dir.length > 1) {
@@ -32,9 +34,11 @@ OC.Share={
// Search for possible parent folders that are shared
while (path != last) {
if (path == item) {
- var img = $('.fileactions .action').filterAttr('data-action', 'Share').find('img');
+ var action = $('.fileactions .action').filterAttr('data-action', 'Share');
+ var img = action.find('img');
if (img.attr('src') != OC.imagePath('core', 'actions/public')) {
img.attr('src', image);
+ action.addClass('permanent');
}
}
last = path;
@@ -48,7 +52,8 @@ OC.Share={
},
updateIcon:function(itemType, itemSource) {
if (itemType == 'file' || itemType == 'folder') {
- var filename = $('tr').filterAttr('data-id', String(itemSource)).data('file');
+ var file = $('tr').filterAttr('data-id', String(itemSource));
+ var filename = file.data('file');
if ($('#dir').val() == '/') {
itemSource = $('#dir').val() + filename;
} else {
@@ -75,6 +80,14 @@ OC.Share={
});
if (itemType != 'file' && itemType != 'folder') {
$('a.share[data-item="'+itemSource+'"]').css('background', 'url('+image+') no-repeat center');
+ } else {
+ var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share');
+ action.find('img').attr('src', image);
+ if (shares) {
+ action.addClass('permanent');
+ } else {
+ action.removeClass('permanent');
+ }
}
if (shares) {
OC.Share.statuses[itemSource] = link;