diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-29 13:17:47 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-29 13:17:47 +0200 |
commit | f2cd334c8a9c3d21772c5f30a92d95e254e113d8 (patch) | |
tree | 513a85bab43424e0f26b2ef590a2d91bfde21fdf /apps/files/js/filelist.js | |
parent | 54b507306a015b3ab7ec72f85a13788136befcf5 (diff) | |
parent | cc8efaa037fdf186f413beadd1ed1ab49d2f6756 (diff) | |
download | nextcloud-server-f2cd334c8a9c3d21772c5f30a92d95e254e113d8.tar.gz nextcloud-server-f2cd334c8a9c3d21772c5f30a92d95e254e113d8.zip |
Merge pull request #19417 from owncloud/files-upload-checkconflictbeforeupload
Show conflict dialog before upload when possible
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index e4a7aadd600..1b069530e69 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -719,8 +719,23 @@ return true; }, /** - * Returns the tr element for a given file name - * @param fileName file name + * Returns the file info for the given file name from the internal collection. + * + * @param {string} fileName file name + * @return {OCA.Files.FileInfo} file info or null if it was not found + * + * @since 8.2 + */ + findFile: function(fileName) { + return _.find(this.files, function(aFile) { + return (aFile.name === fileName); + }) || null; + }, + /** + * Returns the tr element for a given file name, but only if it was already rendered. + * + * @param {string} fileName file name + * @return {Object} jQuery object of the matching row */ findFileEl: function(fileName){ // use filterAttr to avoid escaping issues @@ -1877,7 +1892,7 @@ * @return {bool} true if the file exists in the list, false otherwise */ inList:function(file) { - return this.findFileEl(file).length; + return this.findFile(file); }, /** |