summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-02-11 16:09:04 +0100
committerRobin Appelman <icewind@owncloud.com>2013-02-11 16:09:04 +0100
commit37ea7842942b4f8c27149992a8e6e15c7911d694 (patch)
treed73c7e4c8f7190082fde11825c8cd1041bbe0c19 /apps
parenteed48c815915cb57e2e6af75ad052fefdf922a73 (diff)
downloadnextcloud-server-37ea7842942b4f8c27149992a8e6e15c7911d694.tar.gz
nextcloud-server-37ea7842942b4f8c27149992a8e6e15c7911d694.zip
Files: always show share action at the right
Fixes #1619
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/fileactions.js27
1 files changed, 18 insertions, 9 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index e1d8b60d315..38f5bab6f73 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -81,7 +81,7 @@ var FileActions = {
event.data.actionFunc(file);
};
- $.each(actions, function (name, action) {
+ var addAction = function (name, action) {
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name === 'Rename' && $('#dir').val() === '/Shared') {
return true;
@@ -92,7 +92,7 @@ var FileActions = {
if (img.call) {
img = img(file);
}
- var html = '<a href="#" class="action" data-action="'+name+'">';
+ var html = '<a href="#" class="action" data-action="' + name + '">';
if (img) {
html += '<img class ="svg" src="' + img + '" /> ';
}
@@ -101,18 +101,27 @@ var FileActions = {
var element = $(html);
element.data('action', name);
//alert(element);
- element.on('click',{a:null, elem:parent, actionFunc:actions[name]},actionHandler);
+ element.on('click', {a: null, elem: parent, actionFunc: actions[name]}, actionHandler);
parent.find('a.name>span.fileactions').append(element);
}
+ };
+
+ $.each(actions, function (name, action) {
+ if (name !== 'Share') {
+ addAction(name, action);
+ }
});
+ if(actions.Share){
+ addAction('Share', actions.Share);
+ }
if (actions['Delete']) {
var img = FileActions.icons['Delete'];
if (img.call) {
img = img(file);
}
- if (typeof trashBinApp !== 'undefined' && trashBinApp) {
+ if (typeof trashBinApp !== 'undefined' && trashBinApp) {
var html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete" />';
} else {
var html = '<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" />';
@@ -122,7 +131,7 @@ var FileActions = {
element.append($('<img class ="svg" src="' + img + '"/>'));
}
element.data('action', actions['Delete']);
- element.on('click',{a:null, elem:parent, actionFunc:actions['Delete']},actionHandler);
+ element.on('click', {a: null, elem: parent, actionFunc: actions['Delete']}, actionHandler);
parent.parent().children().last().append(element);
}
},
@@ -146,7 +155,7 @@ $(document).ready(function () {
} else {
var downloadScope = 'file';
}
-
+
if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) {
FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
@@ -154,11 +163,11 @@ $(document).ready(function () {
window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val());
});
}
-
- $('#fileList tr').each(function(){
+
+ $('#fileList tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
-
+
});
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {