diff --git a/portal/assets/js/ynh_portal.js b/portal/assets/js/ynh_portal.js index 89e895d..3a79a21 100644 --- a/portal/assets/js/ynh_portal.js +++ b/portal/assets/js/ynh_portal.js @@ -373,28 +373,4 @@ function tweak_portal_when_in_iframe() window.parent.location.href = logoutButton.getAttribute("href"); }); } -} - -var lastY = 0; // Needed in order to determine direction of scroll. -$(".scroll-container").on('touchstart', function(event) { - lastY = event.touches[0].clientY; -}); - -$('.scroller').on('touchmove', function(event) { - var top = event.touches[0].clientY; - - // Determine scroll position and direction. - var scrollTop = $(event.currentTarget).scrollTop(); - var direction = (lastY - top) < 0 ? "up" : "down"; - - // FIX IT! - if (scrollTop == 0 && direction == "up") { - // Prevent scrolling up when already at top as this introduces a freeze. - event.preventDefault(); - } else if (scrollTop >= (event.currentTarget.scrollHeight - event.currentTarget.outerHeight()) && direction == "down") { - // Prevent scrolling down when already at bottom as this also introduces a freeze. - event.preventDefault(); - } - - lastY = top; -}); \ No newline at end of file +} \ No newline at end of file