]> source.dussan.org Git - nextcloud-server.git/commitdiff
show notification when renaming a file to ''
authorJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 18 Dec 2012 15:37:27 +0000 (16:37 +0100)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Wed, 2 Jan 2013 15:17:30 +0000 (16:17 +0100)
apps/files/js/filelist.js

index 96dd0323d29a4b463ca96d2f6c789fc63a0deb91..cf86cc60979088b3fe87d59618e83c31e3fe3450 100644 (file)
@@ -151,6 +151,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)) {