summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2012-09-19 14:05:09 +0200
committerBjörn Schießle <schiessle@owncloud.com>2012-09-19 14:05:09 +0200
commit223bf3e47cbcb5ed6f7353b7dc5737b6d28452b7 (patch)
tree5f91a9d37f8037d2964ab454bf00494a338f750e
parentc199c4ad67737754c2274a97e3137cee33b7e2d9 (diff)
downloadnextcloud-server-223bf3e47cbcb5ed6f7353b7dc5737b6d28452b7.tar.gz
nextcloud-server-223bf3e47cbcb5ed6f7353b7dc5737b6d28452b7.zip
fix for bug #1752 (Renaming of folders in files view does not work correctly in firefox 15)
-rw-r--r--apps/files/js/filelist.js36
1 files changed, 19 insertions, 17 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index fd4cee90fd1..bbdccb49c5f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -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){