Implemented scroll-to-bottom functionality for button activation.

This commit is contained in:
Kevin Serrano 2016-10-04 17:42:17 -07:00
parent 8671869311
commit 3628c5b324
No known key found for this signature in database
GPG Key ID: 7CC862A58D2889B4
1 changed files with 10 additions and 2 deletions

View File

@ -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'),
])
)
}