summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-09 09:34:24 +0100
committerGitHub <noreply@github.com>2017-11-09 09:34:24 +0100
commitc91515cfedc678b9de24ae981573216478cddf27 (patch)
treec825980a4575bf6e61067a2e6888c2e55900e0b4 /apps
parent69e61b2892ce7e9def576e1a9581f00df2369a59 (diff)
parentfe6b4d432b5b3232fe3dd9c928d9c0efdba3d3be (diff)
downloadnextcloud-server-c91515cfedc678b9de24ae981573216478cddf27.tar.gz
nextcloud-server-c91515cfedc678b9de24ae981573216478cddf27.zip
Merge pull request #6847 from nextcloud/filelist-confict-path-12
[12] still trigger conflict resolution for existing entries when the curreā€¦
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js31
1 files changed, 17 insertions, 14 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index a94d0ac7281..bdd4a6ffc37 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1204,23 +1204,26 @@
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="' + this._jqSelEscape(name) + '"]');
- 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);
- }
+
+ var conflictingItems = this.$fileList.find('tr[data-file="' + this._jqSelEscape(name) + '"]');
+ 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);
+ }
+ if (firstConflictPath && firstConflictPath !== '/') {
$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);
- }
+ var conflictPath = path + '/';
+ if (conflictPath.charAt(0) === '/') {
+ conflictPath = conflictPath.substr(1);
+ }
+ if (path && path !== '/') {
nameSpan.append($('<span></span>').addClass('conflict-path').text(conflictPath));
}
}