Skip to content

Commit

Permalink
fixed bug where body click events were not publishing on iOS mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Dec 26, 2016
1 parent 271073b commit 3ed9c88
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/util/init.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import Bus from './bus'

export default function () {
document.body.addEventListener('click', e => {
Bus.pub('body:click', e)
})
const click = e => Bus.pub('body:click', e)

if (window.orientation !== 'undefined') {
document.body.addEventListener('touchstart', click, false)
} else {
document.body.addEventListener('click', click, false)
}

Bus.sub('meta:title', title => {
document.title = title
Expand Down

0 comments on commit 3ed9c88

Please sign in to comment.