aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 39c80ce0be9..5b0d61d7af9 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -149,6 +149,10 @@ var FileList={
var newname=input.val();
if (Files.containsInvalidCharacters(newname)) {
return false;
+ } else if (newname.length == 0) {
+ $('#notification').text(t('files', "Name cannot be empty."));
+ $('#notification').fadeIn();
+ return false;
}
if (newname != name) {
if (FileList.checkName(name, newname, false)) {
@@ -183,6 +187,13 @@ var FileList={
td.children('a.name').show();
return false;
});
+ input.keyup(function(event){
+ if (event.keyCode == 27) {
+ tr.data('renaming',false);
+ form.remove();
+ td.children('a.name').show();
+ }
+ });
input.click(function(event){
event.stopPropagation();
event.preventDefault();