diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-12-05 23:51:44 +0100 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-12-05 23:52:14 +0100 |
commit | a0548a416a56f6e0fd3269279777d57156c47d15 (patch) | |
tree | 162b2a18f93dfdb140536364d4387d9d65740e3c /files/js | |
parent | 31846141b0269bb24b9925a1bbbbc5d815719bec (diff) | |
download | nextcloud-server-a0548a416a56f6e0fd3269279777d57156c47d15.tar.gz nextcloud-server-a0548a416a56f6e0fd3269279777d57156c47d15.zip |
Don't trigger file action when renaming, stupid fix for stupid firefox behaviour
Diffstat (limited to 'files/js')
-rw-r--r-- | files/js/filelist.js | 11 | ||||
-rw-r--r-- | files/js/files.js | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/files/js/filelist.js b/files/js/filelist.js index 5740ece9716..16f73ed58d6 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -125,7 +125,7 @@ FileList={ tr.data('renaming',true); var td=tr.children('td.filename'); var input=$('<input class="filename"></input>').val(name); - var form=$('<form action="#"></form>') + var form=$('<form></form>') form.append(input); td.children('a.name').text(''); td.children('a.name').append(form) @@ -134,7 +134,6 @@ FileList={ event.stopPropagation(); event.preventDefault(); var newname=input.val(); - tr.data('renaming',false); tr.attr('data-file',newname); td.children('a.name').empty(); if(newname.indexOf('.')>0){ @@ -148,12 +147,12 @@ FileList={ if(newname.indexOf('.')>0){ span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>')); } - $.ajax({ - url: 'ajax/rename.php', - data: { dir : $('#dir').val(), newname: newname, file: name } + $.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){ + tr.data('renaming',false); }); + return false; }); - form.click(function(event){ + input.click(function(event){ event.stopPropagation(); event.preventDefault(); }); diff --git a/files/js/files.js b/files/js/files.js index 53437453ff9..5a528f5122c 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -70,7 +70,9 @@ $(document).ready(function() { procesSelection(); } else { var filename=$(this).parent().parent().attr('data-file'); - if(!FileList.isLoading(filename)){ + var tr=$('tr').filterAttr('data-file',filename); + var renaming=tr.data('renaming') + if(!renaming && !FileList.isLoading(filename)){ var mime=$(this).parent().parent().data('mime'); var type=$(this).parent().parent().data('type'); var action=FileActions.getDefault(mime,type); |