Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to handle a failed AJAX load #360

Open
zflat opened this issue May 17, 2018 · 1 comment
Open

Attempting to handle a failed AJAX load #360

zflat opened this issue May 17, 2018 · 1 comment
Assignees

Comments

@zflat
Copy link
Contributor

zflat commented May 17, 2018

Hi, it looks like the "error" status for load should call deferred.reject() and not deferred.fail()

deferred.fail();

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.

@marcandre
Copy link
Collaborator

Good catch. Would you be kind enough to provide a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants