summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraghunayyar <me@iraghu.com>2013-10-03 00:39:03 +0530
committerVincent Petry <pvince81@owncloud.com>2014-01-30 10:07:08 +0100
commit85e67be0aa94d82ef29c2a68009b3897e4bcd63b (patch)
tree1d61b5cc72c4f75009f1dca56539feb501289d28
parent299a8285bd2601ccbac988b2e3e9b067d47921a2 (diff)
downloadnextcloud-server-85e67be0aa94d82ef29c2a68009b3897e4bcd63b.tar.gz
nextcloud-server-85e67be0aa94d82ef29c2a68009b3897e4bcd63b.zip
Rename action now appears as pencil icon
-rw-r--r--apps/files/css/files.css1
-rw-r--r--apps/files/js/fileactions.js21
-rw-r--r--apps/files/js/filelist.js1
3 files changed, 18 insertions, 5 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index ca3b8500669..38f01bfab33 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -258,6 +258,7 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; }
position: absolute;
top: 14px;
right: 0;
+ font-size: 11px;
}
#fileList img.move2trash { display:inline; margin:-8px 0; padding:16px 8px 16px 8px !important; float:right; }
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index d0ef2491bdf..f36457f01a8 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -71,13 +71,15 @@ var FileActions = {
FileActions.currentFile = parent;
var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file = FileActions.getCurrentFile();
+ var nameLinks;
if (FileList.findFileEl(file).data('renaming')) {
return;
}
// recreate fileactions
- parent.children('a.name').find('.fileactions').remove();
- parent.children('a.name').append('<span class="fileactions" />');
+ nameLinks = parent.children('a.name');
+ nameLinks.find('.fileactions, .nametext .action').remove();
+ nameLinks.append('<span class="fileactions" />');
var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var actionHandler = function (event) {
@@ -97,7 +99,16 @@ var FileActions = {
}
if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') {
- var img = FileActions.icons[name];
+ var img = FileActions.icons[name],
+ actionText = t('files', name),
+ actionContainer = 'a.name>span.fileactions';
+
+ if (name === 'Rename') {
+ // rename has only an icon which appears behind
+ // the file name
+ actionText = '';
+ actionContainer = 'a.name span.nametext';
+ }
if (img.call) {
img = img(file);
}
@@ -105,13 +116,13 @@ var FileActions = {
if (img) {
html += '<img class ="svg" src="' + img + '" />';
}
- html += '<span> ' + t('files', name) + '</span></a>';
+ html += '<span> ' + actionText + '</span></a>';
var element = $(html);
element.data('action', name);
//alert(element);
element.on('click', {a: null, elem: parent, actionFunc: actions[name]}, actionHandler);
- parent.find('a.name>span.fileactions').append(element);
+ parent.find(actionContainer).append(element);
}
};
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 63fd0f4ce05..23b31e72467 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -477,6 +477,7 @@ var FileList={
td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.')));
}
form.remove();
+ FileActions.display( tr.find('td.filename'), true);
td.children('a.name').show();
} catch (error) {
input.attr('title', error);