1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00

Add conditional logic for adding listener.

This commit is contained in:
Kevin Serrano 2016-10-04 20:49:06 -07:00
parent 1158855a15
commit 64d8f91371
No known key found for this signature in database
GPG Key ID: 7CC862A58D2889B4

View File

@ -62,9 +62,11 @@ 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')
var button = document.getElementById('agree')
if ((object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) && button.disabled) {
button.disabled = false
button.innerHTML = 'I Agree'
console.log("YAHALLO")
button.addEventListener('click', () => this.props.dispatch(actions.agreeToDisclaimer()))
}
},
@ -89,7 +91,7 @@ DisclaimerScreen.prototype.render = function () {
style: { marginTop: '18px' },
disabled: true,
onClick: () => this.props.dispatch(actions.agreeToDisclaimer()),
}, 'I Agree'),
}, 'Scroll to Enable'),
])
)
}