summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-10-28 16:01:50 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-10-28 16:02:05 -0400
commit60e5054ae8bd5e85e6116e52a3de311c71b8b453 (patch)
tree19eef225eba53bc1184b699e752d26cd6e7183cf /apps
parentf3971e659b51dfe9e351274f63ce525a23806dab (diff)
downloadnextcloud-server-60e5054ae8bd5e85e6116e52a3de311c71b8b453.tar.gz
nextcloud-server-60e5054ae8bd5e85e6116e52a3de311c71b8b453.zip
Fix shared status icons
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/fileactions.js2
-rw-r--r--apps/files_sharing/js/share.js34
2 files changed, 5 insertions, 31 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 901c685ecb2..82d990bf780 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -80,7 +80,7 @@ var FileActions = {
if (img.call) {
img = img(file);
}
- var html = '<a href="#" class="action">';
+ var html = '<a href="#" class="action" data-action="'+name+'">';
if (img) {
html += '<img class ="svg" src="' + img + '"/> ';
}
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 72663c068c9..7eb086712f4 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,36 +1,8 @@
$(document).ready(function() {
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !publicListView) {
- OC.Share.loadIcons('file');
- FileActions.register('all', 'Share', OC.PERMISSION_READ, function(filename) {
- // Return the correct sharing icon
- if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback
- if ($('#dir').val() == '/') {
- var item = $('#dir').val() + filename;
- } else {
- var item = $('#dir').val() + '/' + filename;
- }
- // Check if status is in cache
- if (OC.Share.statuses[item] === true) {
- return OC.imagePath('core', 'actions/public');
- } else if (OC.Share.statuses[item] === false) {
- return OC.imagePath('core', 'actions/shared');
- } else {
- var last = '';
- var path = OC.Share.dirname(item);
- // Search for possible parent folders that are shared
- while (path != last) {
- if (OC.Share.statuses[path] === true) {
- return OC.imagePath('core', 'actions/public');
- } else if (OC.Share.statuses[path] === false) {
- return OC.imagePath('core', 'actions/shared');
- }
- last = path;
- path = OC.Share.dirname(path);
- }
- return OC.imagePath('core', 'actions/share');
- }
- }, function(filename) {
+
+ FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) {
if ($('#dir').val() == '/') {
var item = $('#dir').val() + filename;
} else {
@@ -59,6 +31,8 @@ $(document).ready(function() {
OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions);
}
});
+ OC.Share.loadIcons('file');
}
+
}); \ No newline at end of file