I'm working off the AngularJS example
At this point, uploads are working (to s3), but my onSubmit callback exploding: [Fine Uploader 5.0.2] Caught exception in 'onSubmitted' callback - undefined is not a function
This may be a cofeescript fat arrow problem, since I transpiled the example to coffeescript for my build environment (and my preference for coffeescript), but I'm stumped anyhow.
Here's the relevant dict for the options.
callbacks: {
onSubmitted: (id, name) =>
console.log "calling onSubmitted(#{id}, #{name})"
console.log "This shouldn't be undefined: #{@getItemByFileId}"
# but it _is_ undefined
$file = $(@getItemByFileId(id))
console.log $file
$thumbnail = $file.find(".qq-thumbnail-selector")
$thumbnail.click ->
openLargerPreview(
$scope,
$(element),
largePreviewSize,
id,
name
)
return
return
}
Here's the skinny arrow version (see comments below) as rendered into JS:
callbacks: {
onSubmitted: function(id, name) {
var $file, $thumbnail;
console.log("calling onSubmitted(" + id + ", " + name + ")");
$file = $(getItemByFileId(id));
console.log($file);
$thumbnail = $file.find(".qq-thumbnail-selector");
$thumbnail.click(function() {
openLargerPreview($scope, $(element), largePreviewSize, id, name);
});
}
}
the result (when I upload something) is
[Fine Uploader 5.0.2] Received 1 files or inputs.
[Fine Uploader 5.0.2] Attempting to validate image.
calling onSubmitted(0, IMAG0161.jpg)
This shouldn't be undefined: undefined
[Fine Uploader 5.0.2] Caught exception in 'onSubmitted' callback - undefined is not a function
as indicated in the code, the problem (as I understand it) is that @getItemByFileId
is not defined on this
properly, where (again, as I understand it) this
should be the fineuploaderS3 object.