浏览代码

enable hiding of address bar for ios chrome #582

Hakim El Hattab 11 年之前
父节点
当前提交
2578fddd3f
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 2
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 3 - 2
js/reveal.js

@@ -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 );
@@ -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%';
 		}

文件差异内容过多而无法显示
+ 1 - 1
js/reveal.min.js


部分文件因为文件数量过多而无法显示