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

fix(docs): fix compatibility with IE #1659

Merged
merged 1 commit into from
May 8, 2017
Merged

Conversation

layershifter
Copy link
Member

This fixes docs compatibility with IE.

@@ -27,6 +35,7 @@ export const semanticUICSSRepoURL = 'https://github.com/Semantic-Org/Semantic-UI

export const scrollToAnchor = () => {
const anchor = location.hash && document.querySelector(location.hash)
const offsetY = window.scrollY || window.pageYOffset
Copy link
Member Author

@layershifter layershifter May 7, 2017

Choose a reason for hiding this comment

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

pageYOffset is alias for scrollY, but it's supported from IE 9

const scrollStep = Math.ceil((Math.abs(elementTop / 8))) * Math.sign(elementTop)
const isScrolledToTop = offsetY === 0
const isScrolledToBottom = offsetY + document.body.clientHeight === document.body.scrollHeight
const scrollStep = Math.ceil((Math.abs(elementTop / 8))) * mathSign(elementTop)
Copy link
Member Author

Choose a reason for hiding this comment

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

Math.sign is not supported in IE at all.

@codecov-io
Copy link

codecov-io commented May 7, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@9820e62). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1659   +/-   ##
=========================================
  Coverage          ?   99.75%           
=========================================
  Files             ?      141           
  Lines             ?     2406           
  Branches          ?        0           
=========================================
  Hits              ?     2400           
  Misses            ?        6           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9820e62...c0aec92. Read the comment docs.

@levithomason levithomason merged commit df96ba4 into master May 8, 2017
@levithomason levithomason deleted the docs/fixes-in-ie branch May 8, 2017 23:18
@levithomason
Copy link
Member

Thanks for the updates.

@levithomason
Copy link
Member

Released in semantic-ui-react@0.68.4.

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

Successfully merging this pull request may close these issues.

3 participants