diff options
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index d6a4ae99764..503bf681139 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -421,15 +421,12 @@ window.FileList={ len = input.val().length; } input.selectRange(0, len); - var checkInput = function () { var filename = input.val(); if (filename !== oldname) { - if (!Files.isFileNameValid(filename)) { - // Files.isFileNameValid(filename) throws an exception itself - } else if($('#dir').val() === '/' && filename === 'Shared') { - throw t('files','In the home folder \'Shared\' is a reserved filename'); - } else if (FileList.inList(filename)) { + // Files.isFileNameValid(filename) throws an exception itself + Files.isFileNameValid(filename, FileList.getCurrentDirectory()); + if (FileList.inList(filename)) { throw t('files', '{new_name} already exists', {new_name: filename}); } } @@ -1158,9 +1155,9 @@ $(document).ready(function() { // need to initially switch the dir to the one from the hash (IE8) FileList.changeDirectory(parseCurrentDirFromUrl(), false, true); } - } - FileList.setCurrentDir(parseCurrentDirFromUrl(), false); + FileList.setCurrentDir(parseCurrentDirFromUrl(), false); + } FileList.createFileSummary(); }); |