Ver Fonte

Fixed touch based scrolling

Nathaniel van Diepen há 10 anos atrás
pai
commit
0174c71788
2 ficheiros alterados com 2 adições e 19 exclusões
  1. 2 2
      data/topbars/default.template
  2. 0 17
      js/index.js

+ 2 - 2
data/topbars/default.template

@@ -14,7 +14,7 @@
 	{{#if key}}
 		<span class="menuitem screen-large" onclick="$(this).children('.menu').toggle();">
 			<span  style="background-image:url(img/headers/icons/menu.png);background-repeat:no-repeat;height:50px;width:35px;background-position:center;float:left;"></span>			
-			<ul class="menu top" style="display:none;margin-top:50px;position:absolute;left:0;">
+			<ul class="menu top" style="display:none;margin-top:50px;position:fixed;left:0;">
 				<li>
 					<a href="#page-index">
 						Home
@@ -65,7 +65,7 @@
 			<span style="float:left">
 				{{user.name}} <span class="topbar-notifications"></span>
 			</span>
-			<ul class="menu top" style="display:none;margin-top:50px;position:absolute;right:0;">
+			<ul class="menu top" style="display:none;margin-top:50px;position:fixed;right:0;">
 				<li>
 					<a href="#~{{user.name}}">
 						Profile

+ 0 - 17
js/index.js

@@ -710,32 +710,15 @@
 		if(!exists($.support.touch)){
 			$.support.touch = 'ontouchstart' in window || 'onmsgesturechange' in window;
 		}
-		// $('#content').niceScroll({
-		// 	cursorwidth: 10,
-		// 	nativeparentscrolling: false,
-		// 	preservenativescrolling: false
-		// });
 		$('#content,#topbar').click(function(){
 			$('.menu').hide();
 		});
-		document.addEventListener('touchmove',function(e){
-			e.preventDefault();
-		});
 		$(window).resize(function(){
 			if($(window).width()>767){
 				$('#topbar div.topbar-right, #topbar div.topbar-left').css({
 					'display': ''
 				});
 			}
-			// var c = $('#content'),
-			// 	flag = c.get(0).scrollHeight-c.scrollTop() == c.outerHeight();
-			// c.height($('body').height()-$('#topbar').height());
-			// c.getNiceScroll().resize();
-			// if(flag){
-			// 	c.animate({
-			// 		scrollTop: c.height()
-			// 	},'slow');
-			// }
 			render.inputs('#content');
 			render.inputs('#topbar');
 		});