From 92b37119e36a6c7d418e56d7c6d73fd4625210b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Tue, 2 Oct 2012 18:38:17 +0200 Subject: [PATCH] remove textbox after pressing "enter" even if the name is the same --- apps/files/js/filelist.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 683f7db867..4bce4a624e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -157,22 +157,21 @@ var FileList={ }); } - - 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.text(basename); - td.children('a.name').append(span); - if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { - span.append($(''+newname.substr(newname.lastIndexOf('.'))+'')); - } + } + 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.text(basename); + td.children('a.name').append(span); + if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { + span.append($(''+newname.substr(newname.lastIndexOf('.'))+'')); } return false; });