aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-19 11:33:25 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-19 11:33:25 +0200
commit6f2fe8c62a5dbcb73986ce455b3f1eddea851a0d (patch)
treecb58719d55fdfef16512c8cb0b317945cc85cd30 /apps/files/js/filelist.js
parent5e48ce98c70fa511ea2c1caeb332594912c9d96a (diff)
downloadnextcloud-server-6f2fe8c62a5dbcb73986ce455b3f1eddea851a0d.tar.gz
nextcloud-server-6f2fe8c62a5dbcb73986ce455b3f1eddea851a0d.zip
Show the path, when the filename conflicts
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 896af1dd6e5..159d008e6e6 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1148,6 +1148,28 @@
}
var nameSpan=$('<span></span>').addClass('nametext');
var innernameSpan = $('<span></span>').addClass('innernametext').text(basename);
+
+ if (path && path !== '/') {
+ var conflictingItems = this.$fileList.find('tr[data-file="' + name.replace( /(:|\.|\[|\]|,|=)/g, "\\$1") + '"]');
+ if (conflictingItems.length !== 0) {
+ if (conflictingItems.length === 1) {
+ // Update the path on the first conflicting item
+ var $firstConflict = $(conflictingItems[0]),
+ firstConflictPath = $firstConflict.attr('data-path') + '/';
+ if (firstConflictPath.charAt(0) === '/') {
+ firstConflictPath = firstConflictPath.substr(1);
+ }
+ $firstConflict.find('td.filename span.innernametext').prepend($('<span></span>').addClass('conflict-path').text(firstConflictPath));
+ }
+
+ var conflictPath = path + '/';
+ if (conflictPath.charAt(0) === '/') {
+ conflictPath = conflictPath.substr(1);
+ }
+ nameSpan.append($('<span></span>').addClass('conflict-path').text(conflictPath));
+ }
+ }
+
nameSpan.append(innernameSpan);
linkElem.append(nameSpan);
if (extension) {