Navigation Menu

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

data-at2x attribute overridden by is_external() #122

Closed
jxpx777 opened this issue Dec 9, 2013 · 1 comment
Closed

data-at2x attribute overridden by is_external() #122

jxpx777 opened this issue Dec 9, 2013 · 1 comment

Comments

@jxpx777
Copy link

jxpx777 commented Dec 9, 2013

We discovered that RetinaJS wasn't working for us on our production server. Eventually, we discovered it was because our site uses SSL for all pages and we use CloudFront, also over SSL, for our asset host.

I was surprised to find that check_2x_variant was called even though, since we have data-at2x attribute, this.perform_check is set to false. I believe that this else if statement should be before the check for is_external() in order to avoid this issue. If the markup specifies the data-at2x, RetinaJS should short circuit IMHO to simply use the value specified and not do any other checking whatsoever.

@heygambo
Copy link

heygambo commented Jan 9, 2014

+1 you made my day!

just swaped the conditions:

    if (!this.perform_check && typeof this.at_2x_path !== "undefined" && this.at_2x_path !== null) {
      return callback(true);
    } else if (this.is_external()) {
      return callback(false);

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

Successfully merging a pull request may close this issue.

3 participants