Skip to content

Commit

Permalink
fix(event): has no effect on a FF mobile browser, fixed #67
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 11, 2017
1 parent 19b6690 commit 0ff36c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## 2.3.0

> 2017-02-11
### Features

- feat(src): add alias feature

### Bug fixes
- fix(event): `auto2top` has no effect on a FF mobile browser, fixed #67


## 2.2.1

> 2017-02-11
Expand Down
4 changes: 3 additions & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ export function bindToggle (dom) {
}
}

const scrollingElement = document.scrollingElement || document.documentElement

export function scroll2Top (offset = 0) {
document.body.scrollTop = offset === true ? 0 : Number(offset)
scrollingElement.scrollTop = offset === true ? 0 : Number(offset)
}

export function sticky () {
Expand Down

0 comments on commit 0ff36c2

Please sign in to comment.