Commit 3f26a3a2 authored by Fabian-Andree Heidemann's avatar Fabian-Andree Heidemann
Browse files

[fileselector] fix #2021: the file selector always fires the callback. The...

[fileselector] fix #2021: the file selector always fires the callback. The first argument is null, if it is just closed
parent ac450bab
......@@ -34,6 +34,7 @@ define(["jquery", "../base/actions"], function($, FileBaseActions) {
} else {
self.FileBase.instance.callback(paths[0], self.FileBase.instance.cb_args);
}
self.FileBase.workflow.callbackFired = true;
self.FileBase.instance.close();
}
});
......
......@@ -17,9 +17,10 @@
// Default: your personal preferences for the file extension
// "sort": string. possible values are: "name", "type", "time", "ext"
// "reverse": bool (true or false)
// "callback": function(path_array || path_string, cb_args){return;}
// This function is executed with the path array. It supports
// additional arguments, see cb_args
// "callback": function(path_array || path_string || null, cb_args){return;}
// This function is executed with the path array/string or null, if
// the selector is closed without selection. It supports additional
// arguments, see cb_args
// "cb_args": additional arguments which can be passed to the callback function
// }
// a.createInstance(wid, FileSelectorView, args)
......
......@@ -213,6 +213,7 @@ define(["vispa/views/center", "vispa/views/dialog", "./menuentries", "./browser/
self.setLoading(false);
},
onClose: function() {
if (!this.fb.workflow.callbackFired) this.callback(null, this.cb_args);
this.removeSocketListener("watch");
this.POST("/ajax/fs/unwatch", {
watch_id: "0"
......
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