featherlight
featherlight copied to clipboard
Attempting to handle a failed AJAX load
Hi, it looks like the "error" status for load should call deferred.reject() and not deferred.fail()
https://github.com/noelboss/featherlight/blob/c4ed1235ebfdcec54a7a2946c461410de60f61e2/src/featherlight.js#L398
I am using it like this:
var modal = new $.featherlight("/my-uri")
var p = modal.open()
p.fail(function() {
console.log("fail callback")
})
If the URL provided is a 404 for example, the fail callback does not get fired because you don't reject the deferred object.
Good catch. Would you be kind enough to provide a PR?