@@ -185,30 +185,34 @@ document.querySelectorAll('.btn-clipboard').forEach(function (el) {
185
185
} ) ( ) ;
186
186
187
187
// Update donate button text on fundraising page based on interval selection
188
- document . getElementById ( 'id_interval' ) . addEventListener ( 'change' , function ( ) {
189
- const text = this . value === 'onetime' ? 'Donate' : `Donate ${ this . value } ` ;
188
+ document
189
+ . querySelector ( '#donate #id_interval' )
190
+ . addEventListener ( 'change' , function ( ) {
191
+ const text = this . value === 'onetime' ? 'Donate' : `Donate ${ this . value } ` ;
190
192
191
- document . getElementById ( 'donate-button' ) . value = text ;
192
- } ) ;
193
+ document . getElementById ( 'donate-button' ) . value = text ;
194
+ } ) ;
193
195
194
196
// Manage custom donation amount input on fundraising page
195
- document . getElementById ( 'id_amount' ) . addEventListener ( 'change' , function ( ) {
196
- if ( this . value !== 'custom' ) {
197
- return ;
198
- }
197
+ document
198
+ . querySelector ( '#donate #id_amount' )
199
+ . addEventListener ( 'change' , function ( ) {
200
+ if ( this . value !== 'custom' ) {
201
+ return ;
202
+ }
199
203
200
- const input_el = document . createElement ( 'input' ) ;
204
+ const input_el = document . createElement ( 'input' ) ;
201
205
202
- input_el . setAttribute ( 'type' , 'number' ) ;
203
- input_el . setAttribute ( 'name' , 'amount' ) ;
206
+ input_el . setAttribute ( 'type' , 'number' ) ;
207
+ input_el . setAttribute ( 'name' , 'amount' ) ;
204
208
205
- const custom_donation_el = document . querySelector ( '.custom-donation' ) ;
209
+ const custom_donation_el = document . querySelector ( '.custom-donation' ) ;
206
210
207
- custom_donation_el . appendChild ( input_el ) ;
208
- custom_donation_el . style . display = 'block' ;
211
+ custom_donation_el . appendChild ( input_el ) ;
212
+ custom_donation_el . style . display = 'block' ;
209
213
210
- this . remove ( ) ;
214
+ this . remove ( ) ;
211
215
212
- input_el . focus ( ) ;
213
- input_el . value = '25' ;
214
- } ) ;
216
+ input_el . focus ( ) ;
217
+ input_el . value = '25' ;
218
+ } ) ;
0 commit comments