diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-11-19 11:42:17 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-22 16:05:51 +0100 |
commit | d3383adb71d7f05642610490b747f92958c7d357 (patch) | |
tree | cdc36aadcbffeacaa647f583e0af6d9ef049a440 /apps/files | |
parent | ec3166742b08eabcca2c6d2166070b4cee488bf7 (diff) | |
download | nextcloud-server-d3383adb71d7f05642610490b747f92958c7d357.tar.gz nextcloud-server-d3383adb71d7f05642610490b747f92958c7d357.zip |
Fix issue when renaming creates a separate entry
Diffstat (limited to 'apps/files')
-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 83c7e147d46..672c39a8bb1 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1806,10 +1806,8 @@ } function updateInList(fileInfo) { - tr.remove(); - tr = self.add(fileInfo, {updateSummary: false, silent: true}); - self.$fileList.trigger($.Event('fileActionsReady', {fileList: self, $files: $(tr)})); - self._updateDetailsView(fileInfo.name); + self.updateRow(tr, fileInfo); + self._updateDetailsView(fileInfo.name, false); } // TODO: too many nested blocks, move parts into functions @@ -1838,11 +1836,10 @@ td.children('a.name').show(); var path = tr.attr('data-path') || self.getCurrentDirectory(); - self.filesClient.move(path + '/' + oldName, path + '/' + newName) + self.filesClient.move(OC.joinPaths(path, oldName), OC.joinPaths(path, newName)) .done(function() { - var fileInfo = self.files.splice(tr.index(), 1)[0]; - fileInfo.name = newName; - updateInList(fileInfo); + oldFileInfo.name = newName; + updateInList(oldFileInfo); }) .fail(function(status) { // TODO: 409 means current folder does not exist, redirect ? |