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

Better calc detection & fallback, code optimisations & cleanup #70

Merged
merged 9 commits into from
Apr 14, 2015

Conversation

IanCaunce
Copy link
Contributor

Changes

  • Added better calc detection
  • Added fallback support for any browser which doesn't natively support calc. (Mainly needed for android 3+ & 12.x opera)
  • Various code optimisations such as removing unnecessary creation of jQuery objects & node caching.
  • Code clean up by re-writing parts to the most common style in the file & removal of unnecessary comments.
  • Replaced the ; with a + on the self executing function as some minifiers strip the first one out.
  • Added a ! to the first comment to prevent minifiers from stripping it out by default.

I apologise in advance if I was meant to create separate pull requests for these changes. This is my first on github.

Commit: 4d9a3a8
For some unknown reason, when the parent element to the rrssb-buttons element has a percentage padding left & right, with the calc polyfill in place and the child elements widths add up to that of the parent, the last element will wrap to a newline. The 1px saftey net sorts that issue out.

Edit: The issue was caused by browsers rounding fractional pixel widths to the nearest whole pixel. This means you can end up in a situation where the width of the element is reported to be larger than it actually is. The only consistent way I can see is to - 1 off the width given. You can get the fractional width by using $('.something')[0].getBoundingClientRect().width but unfortunately .width is undefined in <= IE8.

@dbox
Copy link
Contributor

dbox commented Jan 24, 2015

Added to dev branch. will be pushed with next release. thanks!

@dbox dbox closed this Jan 24, 2015
@dbox
Copy link
Contributor

dbox commented Apr 13, 2015

Would you mind resubmitting this to the dev branch? Thanks!

@dbox dbox reopened this Apr 13, 2015
@dbox
Copy link
Contributor

dbox commented Apr 13, 2015

@aicarlson Want to look at this and see if you can get it merged cleanly into latest?

@andrewicarlson
Copy link
Contributor

@dbox Sure, I'll take a look later tonight.

@IanCaunce
Copy link
Contributor Author

@dbox Done. Pull Request #89

Conflicts:
	index.html
	js/rrssb.js
	js/rrssb.min.js
@dbox dbox merged commit cda94f0 into kni-labs:master Apr 14, 2015
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.

3 participants