aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-29 02:26:20 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-29 02:26:32 +0200
commita7748c14c61fbcf412eb96203f2f70e9ef77a9b9 (patch)
tree1f47c9d033d0ec47e4e414f36abea8afab895b29
parent224dbed79c83930b16f2c080a75a0f8cc05bdc61 (diff)
downloadnextcloud-server-a7748c14c61fbcf412eb96203f2f70e9ef77a9b9.tar.gz
nextcloud-server-a7748c14c61fbcf412eb96203f2f70e9ef77a9b9.zip
dont need the ok button for renaming
-rw-r--r--files/css/files.css1
-rw-r--r--files/js/fileactions.js4
-rw-r--r--files/js/filelist.js6
3 files changed, 8 insertions, 3 deletions
diff --git a/files/css/files.css b/files/css/files.css
index 46650418409..57dc05d135c 100644
--- a/files/css/files.css
+++ b/files/css/files.css
@@ -27,6 +27,7 @@ table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:ri
table th#headerDate, table td.date { width:10em; padding:0 .1em 0 1em; text-align:left; }
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
table td.filename a.name { display:block; background-image:url('../img/file.png'); height:1.5em; vertical-align:middle; }
+table td.filename a.name input, table td.filename a.name form { width:100% }
table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 3em; background-position:1em .5em; background-repeat:no-repeat; }
table td.filename .nametext, .modified { float:left; padding:.3em 0; }
table td.filename .nametext { width:80%; }
diff --git a/files/js/fileactions.js b/files/js/fileactions.js
index 4de7fa5542b..359e54dda3c 100644
--- a/files/js/fileactions.js
+++ b/files/js/fileactions.js
@@ -54,6 +54,10 @@ FileActions={
display:function(parent){
FileActions.currentFile=parent;
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
+ var file=FileActions.getCurrentFile();
+ if($('tr[data-file="'+file+'"]').data('renaming')){
+ return;
+ }
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
for(name in actions){
if((name=='Download' || actions[name]!=defaultAction) && name!='Delete'){
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 901c4fe2188..ce904075588 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -105,18 +105,17 @@ FileList={
},
rename:function(name){
var tr=$('tr[data-file="'+name+'"]');
+ tr.data('renaming',true);
var td=tr.children('td.filename');
var input=$('<input value='+name+' class="filename"></input>');
- var button=$('<input type="submit" value="Ok"></input>');
var form=$('<form action="#"></form>')
form.append(input);
- form.append(button);
td.children('a.name').text('');
td.children('a.name').append(form)
input.focus();
- td.children('a.name').append(button);
form.submit(function(event){
var newname=input.val();
+ tr.data('renaming',false);
event.stopPropagation();
event.preventDefault();
tr.attr('data-file',newname);
@@ -140,6 +139,7 @@ FileList={
event.preventDefault();
});
input.blur(function(){
+ tr.data('renaming',false);
td.children('a.name').empty();
if(name.indexOf('.')>0){
basename=name.substr(0,name.indexOf('.'));