Don't trigger file action when renaming, stupid fix for stupid firefox behaviour
This commit is contained in:
parent
31846141b0
commit
a0548a416a
|
@ -125,7 +125,7 @@ FileList={
|
||||||
tr.data('renaming',true);
|
tr.data('renaming',true);
|
||||||
var td=tr.children('td.filename');
|
var td=tr.children('td.filename');
|
||||||
var input=$('<input class="filename"></input>').val(name);
|
var input=$('<input class="filename"></input>').val(name);
|
||||||
var form=$('<form action="#"></form>')
|
var form=$('<form></form>')
|
||||||
form.append(input);
|
form.append(input);
|
||||||
td.children('a.name').text('');
|
td.children('a.name').text('');
|
||||||
td.children('a.name').append(form)
|
td.children('a.name').append(form)
|
||||||
|
@ -134,7 +134,6 @@ FileList={
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var newname=input.val();
|
var newname=input.val();
|
||||||
tr.data('renaming',false);
|
|
||||||
tr.attr('data-file',newname);
|
tr.attr('data-file',newname);
|
||||||
td.children('a.name').empty();
|
td.children('a.name').empty();
|
||||||
if(newname.indexOf('.')>0){
|
if(newname.indexOf('.')>0){
|
||||||
|
@ -148,12 +147,12 @@ FileList={
|
||||||
if(newname.indexOf('.')>0){
|
if(newname.indexOf('.')>0){
|
||||||
span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){
|
||||||
url: 'ajax/rename.php',
|
tr.data('renaming',false);
|
||||||
data: { dir : $('#dir').val(), newname: newname, file: name }
|
|
||||||
});
|
});
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
form.click(function(event){
|
input.click(function(event){
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
|
@ -70,7 +70,9 @@ $(document).ready(function() {
|
||||||
procesSelection();
|
procesSelection();
|
||||||
} else {
|
} else {
|
||||||
var filename=$(this).parent().parent().attr('data-file');
|
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 mime=$(this).parent().parent().data('mime');
|
||||||
var type=$(this).parent().parent().data('type');
|
var type=$(this).parent().parent().data('type');
|
||||||
var action=FileActions.getDefault(mime,type);
|
var action=FileActions.getDefault(mime,type);
|
||||||
|
|
Loading…
Reference in New Issue