Skip to content

Commit

Permalink
fix sidebar becoming unscrollable in Safari 6
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Oct 7, 2012
1 parent 31045ad commit c9c96b7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.html
Expand Up @@ -305,6 +305,13 @@ <h2 id=thanks>Acknowledgements &amp; Thanks</h2>
$('script').first().before(s)
}

// Reflow all elements on the page. <david@14islands.com>
function reflowFixedPositions() {
var docStyle = document.documentElement.style
docStyle.paddingRight = '1px'
setTimeout(function(){ docStyle.paddingRight = '' }, 0)
}

$('.signature code').html(function(i, html){
return html
.replace(/\[([^\[]+)\]$/mg, '<span class=version>$1+</span>')
Expand All @@ -314,6 +321,13 @@ <h2 id=thanks>Acknowledgements &amp; Thanks</h2>
if ($.os.ios || /\bMac.+\bSafari\b/.test(navigator.userAgent))
$(document.body).addClass('emoji-enabled')

$('#sidebar').on('click', 'a[href]', function(e){
setTimeout(function(){
// fixes sidebar becoming unscrollable in Safari 6
reflowFixedPositions()
}, 10)
})

// change the title of the page so bookmarks have a better default
if ($.os.ios || $.os.android)
document.title = 'Zepto Docs'
Expand Down

0 comments on commit c9c96b7

Please sign in to comment.