Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
edulix committed Jun 29, 2023
1 parent df35980 commit 19a941d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ <h2 class="question-title" aria-level="2" ng-bind-html="question.title">
</button>
<button
id="continue-btn"
ng-disabled="!scrolledTo.bottom"
ng-disabled="!scrolledToBottom"
class="btn btn-lg btn-success-action btn-plain col-xs-6 col-sm-4 col-sm-offset-4"
ng-click="questionNext()">
<span>
{{ nextButtonText | i18next }}
<i class="fa fa-chevron-right"></i>
</span>
</button>
<div class="continue-custom-tooltip" ng-if="!scrolledTo.bottom">
<div class="continue-custom-tooltip" ng-if="!scrolledToBottom">
<div class="tooltip-inner">
<strong ng-i18next="avBooth.scrolledToBottom.title"></strong>
<p ng-i18next="avBooth.scrolledToBottom.description"></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
Expand Down

0 comments on commit 19a941d

Please sign in to comment.