Skip to content

Commit

Permalink
enable hiding of address bar for ios chrome hakimel#582
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Sep 4, 2013
1 parent 7cd4af8 commit 2578fdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ var Reveal = (function(){
*/
function hideAddressBar() {

if( /iphone|ipod|android/gi.test( navigator.userAgent ) && !/crios/gi.test( navigator.userAgent ) ) {
if( isMobileDevice ) {
// Events that should trigger the address bar to hide
window.addEventListener( 'load', removeAddressBar, false );
window.addEventListener( 'orientationchange', removeAddressBar, false );
Expand All @@ -781,7 +781,8 @@ var Reveal = (function(){
*/
function removeAddressBar() {

if( window.orientation === 0 ) {
// Portrait and not Chrome for iOS
if( window.orientation === 0 && !/crios/gi.test( navigator.userAgent ) ) {
document.documentElement.style.overflow = 'scroll';
document.body.style.height = '120%';
}
Expand Down
Loading

0 comments on commit 2578fdd

Please sign in to comment.