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

Retina Bug #90

Closed
david-nguyen opened this issue May 6, 2016 · 6 comments
Closed

Retina Bug #90

david-nguyen opened this issue May 6, 2016 · 6 comments

Comments

@david-nguyen
Copy link

I'm pretty sure there is a bug with the retina, because you are calling handleSource to set the src, it calls the original dataSrc and not the split version.

@DKudleichuk
Copy link

I confirm this bug too, please fix it asap

@Mirull
Copy link

Mirull commented May 6, 2016

+1 (used v.1.6.1)

@DKudleichuk
Copy link

DKudleichuk commented May 6, 2016

i believe it is related to this message from changelog:

Marked breakpoints as obsolete. Will be removed in upcoming version. Use srcset and/or the picture element instead.

p.s. here is a hotfix of problem (if you can't replace src with srcset immediately):

function handleSource(ele, attr, dataAttr) {
        var dataSrc = ele.getAttribute(dataAttr);

        if (dataSrc) {

                var dataSrcSplitted = dataSrc.split('|');
                var dataSrc = dataSrcSplitted[isRetina && dataSrcSplitted.length > 1 ? 1 : 0];

            ele[attr] = dataSrc;
            ele.removeAttribute(dataAttr);
        }
    }

@david-nguyen
Copy link
Author

Thanks for the code, I took a look I think this is what the author is referring to for breakpoints

// Example
var bLazy = new Blazy({ 
    breakpoints: [{
          width: 420 // max-width
    , src: 'data-src-small'
     }
       , {
          width: 768 // max-width
        , src: 'data-src-medium'
}]
});

@dinbror
Copy link
Owner

dinbror commented May 6, 2016

Hey guys.

You're right. I'll fix it when I'm home from the Beach tomorrow. You can use 1.5.x or @WPJobs's hotfix until

@dinbror
Copy link
Owner

dinbror commented May 9, 2016

Back from the beach :) Fixed in v. 1.6.2

@dinbror dinbror closed this as completed May 9, 2016
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

4 participants