diff --git a/conservancy/static/js/supporter-page.js b/conservancy/static/js/supporter-page.js index ad0f27f0..b3f03930 100644 --- a/conservancy/static/js/supporter-page.js +++ b/conservancy/static/js/supporter-page.js @@ -36,7 +36,7 @@ if (window.location.hash === "#renew") { window.location.hash = "#renewal"; } -function init_sustainer_forms () { +function init_sustainer_form_validation () { // Forms start in "invalid" form, with the errors shown, so that // non-Javascript users see the errors by default and know what they must // enter. Now we hide those for JavaScript users: @@ -85,7 +85,9 @@ function init_sustainer_forms () { } }); }); +} +function init_sustainer_type_switching () { var selectSupportType = function(event) { var $selectedLink = $(event.target); $(".supporter-type-selector a").removeClass("supporter-type-selector-selected"); @@ -107,10 +109,10 @@ function init_sustainer_forms () { }; function init_expanders () { - // Conservancy does a lot each year, so we initially hide the "Year in - // Review" text insideexpandable
sections to avoid a wall of - // text. If the URL fragment matches one of our expandable sections, we - // automatically expand it - that's a direct link. + // To avoid hitting visitors with a wall of text, we initially hide the + // "Year in Review" and similar text inside expandable
+ // sections. If the URL fragment references one of these sections, we open + // that section. let details = qs('details' + window.location.hash) // eg. #WritingAndSpeaking if (window.location.hash && details) { details.open = true; @@ -129,5 +131,6 @@ function init_expanders () { }); } -init_sustainer_forms(); +init_sustainer_form_validation(); +init_sustainer_type_switching(); init_expanders();