summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/js/filelist.js13
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 ?