From 38d87adbc0795498eee3bcbf1450f61a0d80a4ee Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2021 02:54:32 +0400 Subject: [PATCH] Deleting somes unused parts from last commit --- portal/assets/js/ynh_portal.js | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) 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