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

Fixed issue with wrong active value for widths smalller than smallest breakpoint #10

Merged
merged 3 commits into from
Oct 31, 2016

Conversation

tszarzynski
Copy link

Hey,

I found one issue with your library concerning screen widths below smallest breakpoint.

In situation when my smallest breakpoint was set to 480px:

$breakpoints: (phone: 480px, tablet: 768px, tablet-large: 906px, desktop: 1024px, desktop-large: 1200px);

if i resize the window to a width smaller than 480px from anything larger (let's say >=desktop) the CSS attributes on document.body:after (default element) are being cleared. The JS library is still keeping the old copy of CSS attributes in the memory and reports that my current breakpoint is still 'desktop'.

Please have a look and let me know what you think.

Cheers,
Tomasz

@@ -30,6 +30,9 @@
breakpoints = JSON.parse(removeQuotes(data));
} catch (err) {}
}
else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind putting the else on the previous line, next to the closing curly brace, as per the rest of the file?

Also, should it return null instead of false?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

I'll update formatting in a sec.

When it comes to return value false is the default value for breakpoints variable so i thought it makes more sense. Shall i change it anyway?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you're right! I haven't looked at this code for a while...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed updated version with fixed formatting.

@eduardoboucas
Copy link
Owner

Thanks! 🎉

@eduardoboucas eduardoboucas merged commit 88178cf into eduardoboucas:master Oct 31, 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

Successfully merging this pull request may close these issues.

2 participants