Don't trigger file action when renaming, stupid fix for stupid firefox behaviour

This commit is contained in:
Robin Appelman 2011-12-05 23:51:44 +01:00
parent 31846141b0
commit a0548a416a
2 changed files with 8 additions and 7 deletions

View File

@ -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();
});

View File

@ -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);