fix for bug #1752 (Renaming of folders in files view does not work correctly in firefox 15)
This commit is contained in:
parent
c199c4ad67
commit
223bf3e47c
1 changed files with 19 additions and 17 deletions
|
@ -145,31 +145,33 @@ var FileList={
|
|||
if (newname != name) {
|
||||
if (FileList.checkName(name, newname, false)) {
|
||||
newname = name;
|
||||
} else {
|
||||
} else {
|
||||
$.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(result) {
|
||||
if (!result || result.status == 'error') {
|
||||
OC.dialogs.alert(result.data.message, 'Error moving file');
|
||||
newname = name;
|
||||
}
|
||||
tr.data('renaming',false);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
tr.attr('data-file', newname);
|
||||
var path = td.children('a.name').attr('href');
|
||||
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
var basename=newname.substr(0,newname.lastIndexOf('.'));
|
||||
} else {
|
||||
var basename=newname;
|
||||
}
|
||||
td.children('a.name').empty();
|
||||
var span=$('<span class="nametext"></span>');
|
||||
span.text(basename);
|
||||
td.children('a.name').append(span);
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
||||
}
|
||||
}
|
||||
tr.attr('data-file', newname);
|
||||
var path = td.children('a.name').attr('href');
|
||||
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
var basename=newname.substr(0,newname.lastIndexOf('.'));
|
||||
} else {
|
||||
var basename=newname;
|
||||
}
|
||||
td.children('a.name').empty();
|
||||
var span=$('<span class="nametext"></span>');
|
||||
span.text(basename);
|
||||
td.children('a.name').append(span);
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
||||
}
|
||||
tr.data('renaming',false);
|
||||
return false;
|
||||
});
|
||||
input.click(function(event){
|
||||
|
|
Loading…
Reference in a new issue