From 3628c5b324b1c9afb052bb73bd53026d51116545 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 4 Oct 2016 17:42:17 -0700 Subject: [PATCH] Implemented scroll-to-bottom functionality for button activation. --- ui/app/first-time/disclaimer.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/app/first-time/disclaimer.js b/ui/app/first-time/disclaimer.js index c6174a220..244b7bc97 100644 --- a/ui/app/first-time/disclaimer.js +++ b/ui/app/first-time/disclaimer.js @@ -50,6 +50,14 @@ DisclaimerScreen.prototype.render = function () { `), h('div.markdown', { + onScroll: (e) => { + var object = e.currentTarget + if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) { + var button = document.getElementById('agree') + button.disabled = false + button.addEventListener('click', () => this.props.dispatch(actions.agreeToDisclaimer())) + } + }, style: { // whiteSpace: 'pre-line', background: 'rgb(235, 235, 235)', @@ -67,11 +75,11 @@ DisclaimerScreen.prototype.render = function () { ]), - h('button', { + h('button#agree', { style: { marginTop: '18px' }, + disabled: true, onClick: () => this.props.dispatch(actions.agreeToDisclaimer()), }, 'I Agree'), ]) ) } -