summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/js/share.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/core/js/share.js b/core/js/share.js
index c9b3a4288ac..73c74a7cb6d 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -21,9 +21,12 @@ OC.Share={
if (itemType != 'file' && itemType != 'folder') {
$('a.share[data-item="'+item+'"]').css('background', 'url('+image+') no-repeat center');
} 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 dir = $('#dir').val();
- if ($('#dir').val().length > 1) {
- console.log(item);
+ if (dir.length > 1) {
var last = '';
var path = dir;
// Search for possible parent folders that are shared
@@ -37,14 +40,6 @@ OC.Share={
last = path;
path = OC.Share.dirname(path);
}
- } else {
- var file = $('tr').filterAttr('data-file', OC.basename(item));
- if (file.length > 0) {
- var img = $(file).find('.fileactions .action').filterAttr('data-action', 'Share').find('img');
- if (img.attr('src') != OC.imagePath('core', 'actions/public')) {
- img.attr('src', image);
- }
- }
}
}
});