From 19a941d827dc314586fe953cafd8e4d9029946bb Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Thu, 29 Jun 2023 15:41:39 +0200 Subject: [PATCH] WIP --- .../simultaneous-questions-v2-screen-directive.html | 4 ++-- .../simultaneous-questions-v2-screen-directive.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.html b/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.html index 48112a7d..0b2057f2 100644 --- a/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.html +++ b/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.html @@ -185,7 +185,7 @@

-
+

diff --git a/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.js b/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.js index 55bed5f7..9a355791 100644 --- a/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.js +++ b/avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.js @@ -38,7 +38,7 @@ angular.module('avBooth') var link = function(scope, _element, _attrs) { // records if the page has been scrolled to the bottom - scope.scrolledTo = {bottom: false}; + scope.scrolledToBottom = false; // record when scrolled to bottom function checkScrollToBottom() { @@ -48,8 +48,9 @@ angular.module('avBooth') // if scrolled to bottom, stop recording events as it's not needed // anymore if(currentScroll + modifier >= documentHeight) { - scope.scrolledTo.bottom = true; + scope.scrolledToBottom = true; $window.removeEventListener('scroll', checkScrollToBottom); + scope.$apply(); } } $window.addEventListener('scroll', checkScrollToBottom);