Documentation

API / oninsert callback

This callback function gets executed when users select files to be inserted. The callback has one argument with some properties.

Properties

List of properties for the callback args.

 Name Description
focusedFile File object for the currently focused file. This would normally be the first selected file if the user selects multiple files.
files FileCollection containing all files selected.

Object returned is also an event.

Example

moxman.browse({
oninsert: function(args) {
console.log(args.focusedFile);
}
});

Since its an event, you can prevent the window to close using this method:

moxman.browse({
oninsert : function(args) {
console.log(args.focusedFile);
args.preventDefault();
}
});