Commit d4a32bcc authored by Martin Urban's avatar Martin Urban
Browse files

File: Remove complete list without looping

parent 1d8b995e
...@@ -131,6 +131,7 @@ class FSAjaxController(AbstractController): ...@@ -131,6 +131,7 @@ class FSAjaxController(AbstractController):
self.release_session() self.release_session()
fs = self.get('fs') fs = self.get('fs')
self.release_database() self.release_database()
path = json.loads(path)
# 'path' can be a unicode/string or list of unicodes/strings # 'path' can be a unicode/string or list of unicodes/strings
# so convert it with the convert function # so convert it with the convert function
fs.remove(path) fs.remove(path)
......
...@@ -150,7 +150,6 @@ var FileBaseActions = Class.extend({ ...@@ -150,7 +150,6 @@ var FileBaseActions = Class.extend({
var dfd = self.FileBase.instance.POST("/ajax/fs/paste", { var dfd = self.FileBase.instance.POST("/ajax/fs/paste", {
"path": this.FileBase.workflow.path, "path": this.FileBase.workflow.path,
// "paths": JSON.stringify(paths),
"paths": JSON.stringify(paths), "paths": JSON.stringify(paths),
"cut": cut "cut": cut
}); });
...@@ -186,15 +185,13 @@ var FileBaseActions = Class.extend({ ...@@ -186,15 +185,13 @@ var FileBaseActions = Class.extend({
_remove: function() { _remove: function() {
var self = this; var self = this;
$.each(self.entries, function(index, path) { var dfd = self.FileBase.instance.GET("/ajax/fs/remove", {
var dfd = self.FileBase.instance.GET("/ajax/fs/remove", { "path": JSON.stringify(self.entries)
"path": path });
}); dfd.done(function(response) {
dfd.done(function(response) { self.FileBase.updateView();
self.FileBase.updateView(); this.entries = {};
});
}); });
this.entries = {};
}, },
download: function() { download: function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment