diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-09 09:33:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 09:33:59 +0100 |
commit | 6b3975c23aa3a2579107f1ecba5355c10f736c2b (patch) | |
tree | 9d67c19022e88e3e4e509274eb5a83ecfdc9b4fe | |
parent | 2bfa1ce5c3a23468ef2830680062869c65094b74 (diff) | |
parent | 8eaf1956bb7eac4c948990f889850834b0df4b0e (diff) | |
download | nextcloud-server-6b3975c23aa3a2579107f1ecba5355c10f736c2b.tar.gz nextcloud-server-6b3975c23aa3a2579107f1ecba5355c10f736c2b.zip |
Merge pull request #6846 from nextcloud/filelist-confict-path
still trigger conflict resolution for existing entries when the curreā¦
-rw-r--r-- | apps/files/js/filelist.js | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 4790afcf4d0..68a450e9130 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1249,23 +1249,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)); } } |