File tree Expand file tree Collapse file tree 3 files changed +29
-50
lines changed Expand file tree Collapse file tree 3 files changed +29
-50
lines changed Original file line number Diff line number Diff line change @@ -183,3 +183,32 @@ document.querySelectorAll('.btn-clipboard').forEach(function (el) {
183
183
184
184
window . addEventListener ( 'hashchange' , scroll_to_hash ) ;
185
185
} ) ( ) ;
186
+
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 } ` ;
190
+
191
+ document . getElementById ( 'donate-button' ) . value = text ;
192
+ } ) ;
193
+
194
+ // Manage custom donation amount input on fundraising page
195
+ document . getElementById ( 'id_amount' ) . addEventListener ( 'change' , function ( ) {
196
+ if ( this . value !== 'custom' ) {
197
+ return ;
198
+ }
199
+
200
+ const input_el = document . createElement ( 'input' ) ;
201
+
202
+ input_el . setAttribute ( 'type' , 'number' ) ;
203
+ input_el . setAttribute ( 'name' , 'amount' ) ;
204
+
205
+ const custom_donation_el = document . querySelector ( '.custom-donation' ) ;
206
+
207
+ custom_donation_el . appendChild ( input_el ) ;
208
+ custom_donation_el . style . display = 'block' ;
209
+
210
+ this . remove ( ) ;
211
+
212
+ input_el . focus ( ) ;
213
+ input_el . value = '25' ;
214
+ } ) ;
Original file line number Diff line number Diff line change @@ -16,10 +16,6 @@ define(function () {
16
16
if ( hasClass ( 'fundraising-heart' ) ) {
17
17
mods . push ( 'mod/fundraising-heart' ) ;
18
18
}
19
- //fundraising donation form
20
- if ( hasClass ( 'fundraising-index' ) ) {
21
- mods . push ( 'mod/fundraising-index' ) ;
22
- }
23
19
24
20
if ( hasClass ( 'dashboard-index' ) ) {
25
21
mods . push ( 'dashboard/index' ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments