Nathaniel van Diepen 10 anni fa
parent
commit
0fb73367af
3 ha cambiato i file con 18 aggiunte e 12 eliminazioni
  1. 0 1
      css/style.css
  2. 17 10
      js/index.js
  3. 1 1
      js/jquery.nicescroll.js

+ 0 - 1
css/style.css

@@ -68,7 +68,6 @@ a.topbar-home:hover{
 }
 div#content{
 	width: 100%;
-	height: calc(100% - 35px);
 	-webkit-overflow-scrolling: touch;
 	overflow: auto;
 }

+ 17 - 10
js/index.js

@@ -143,6 +143,7 @@
 							try{
 								if(($(this).hasClass('topbar-home') || $(this).hasClass('topbar-back'))&&$(window).width()<767){
 									$('#topbar').children('div.topbar-right,div.topbar-left').toggle();
+									$('#topbar').resize();
 								}else if($(this).hasClass('topbar-history')){
 									History.back();
 								}else{
@@ -164,6 +165,9 @@
 		setKey(null);
 	}
 	$(document).ready(function(){
+		if(!exists($.support.touch)){
+			$.support.touch = 'ontouchstart' in window || 'onmsgesturechange' in window;
+		}
 		$(window).on('statechange',function(){
 			getNewState();
 			if(!equal(State.data,Old)){
@@ -224,24 +228,27 @@
 				flag('load',false);
 			});
 		},'json');
-		if(!$.support.touch){
-			$('#content').niceScroll({
-				cursorwidth: 10,
-				nativeparentscrolling: false,
-				preservenativescrolling: false
-			});
-			document.addEventListener('touchmove',function(e){
-				e.preventDefault();
-			});
-		}
+		$('#content').niceScroll({
+			cursorwidth: 10,
+			nativeparentscrolling: false,
+			preservenativescrolling: false
+		});
+		document.addEventListener('touchmove',function(e){
+			e.preventDefault();
+		});
 	});
 	$(window).resize(function(){
 		if($(window).width()>767){
 			$('#topbar div.topbar-right, #topbar div.topbar-left').css({
 				'display': ''
 			});
+		}else{
+			$('#content').height($('body').height()-$('#topbar').height());
 			$('#content').getNiceScroll().resize();
 		}
+	}).resize();
+	$('#topbar').resize(function(){
+		$(window).resize();
 	});
 	shortcut.add('f12',function(){
 		if(!flag('firebug-lite')){

+ 1 - 1
js/jquery.nicescroll.js

@@ -128,7 +128,7 @@
 		d.ischrome22 = (d.ischrome&&d.haspointerlock);
     d.ischrome26 = (d.ischrome&&("transition" in domtest.style));  // issue with transform detection (maintain prefix)
     
-    d.cantouch = ("ontouchstart" in document.documentElement)||("ontouchstart" in window);  // detection for Chrome Touch Emulation
+    d.cantouch = ('ontouchstart' in window || 'onmsgesturechange' in window);  // detection for Chrome Touch Emulation
     d.hasmstouch = (window.navigator.msPointerEnabled||false);  // IE10+ pointer events
 		
     d.ismac = /^mac$/i.test(navigator.platform);