Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Small Technology Foundation web site
spikes
patronage
Commits
144d3bcb
Verified
Commit
144d3bcb
authored
Aug 02, 2019
by
Aral Balkan
Browse files
Improve custom amount control
parent
0f8a976f
Changes
1
Hide whitespace changes
Inline
Side-by-side
fund-us/js/index.js
View file @
144d3bcb
...
...
@@ -22,6 +22,8 @@ class PatronageForm {
constructor
()
{
window
.
addEventListener
(
'
load
'
,
this
.
setInitialInterfaceState
.
bind
(
this
))
// TODO: Set key based on hostname.
this
.
stripe
=
Stripe
(
'
pk_test_mLQRpGuO7qq3XMfSgwmt4n8U00FSZOIY1h
'
)
}
...
...
@@ -57,6 +59,10 @@ class PatronageForm {
element
.
addEventListener
(
'
change
'
,
updateFormState
)
})
// Ensure that selecting either the button or the text input focuses the custom
// amount control and that focus is not lost when person clicks on already-selected control.
this
.
interface
.
otherDonationAmountRadioButton
.
addEventListener
(
'
click
'
,
updateFormState
)
this
.
interface
.
otherDonationAmountTextInput
.
addEventListener
(
'
click
'
,
updateFormState
)
this
.
interface
.
otherDonationAmountTextInput
.
addEventListener
(
'
focus
'
,
updateFormState
)
this
.
interface
.
otherDonationAmountTextInput
.
addEventListener
(
'
input
'
,
updateFormState
)
...
...
@@ -82,6 +88,8 @@ class PatronageForm {
// Updates form state in response to interface events.
updateFormState
()
{
console
.
log
(
'
<<< update form state >>>
'
)
// Handle the label of the submit button based on the type of donation.
this
.
interface
.
submitButton
.
innerHTML
=
this
.
isPatronage
?
'
Become a patron
'
:
'
Donate
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment