1(function ($, Drupal) { 2 Drupal.behaviors.hecProgramFinder = { 3 attach: function (context, settings) { 4 $(".program-finder .choice-block, .program-finder .select__option .option").on("click", function (event) { 5 var parentChoice = $(this).parents("hec-choice-block, hec-option"); 6 displayHideSubmitButton(parentChoice); 7 }); 8 } 9 }; 10 11 function displayHideSubmitButton(parentChoice) { 12 if (typeof parentChoice !== "undefined") { 13 var questionSelector = parentChoice.data("next_question_selector"); 14 var nextQuestion = $(questionSelector); 15 var currentSubmit = parentChoice.parents("hec-step-panel").find(".program-finder-content__button"); 16 17 if (nextQuestion.length > 0) { 18 // Keep hiding the more results button if the user come back to a previous step. 19 if (!currentSubmit.hasClass("d-none")) { 20 currentSubmit.addClass("d-none"); 21 } 22 // Detect if all choices are last in order to display directly the submit button. 23 var nextChoices = nextQuestion.find("hec-choice-block"); 24 var isAllLast = true; 25 if (nextChoices.length > 0) { 26 for (var i = 0; i < nextChoices.length; i++) { 27 let isLast = !nextChoices[i].hasAttribute("data-next_question_selector"); 28 isAllLast = isAllLast && isLast; 29 } 30 } 31 // If they are all last, display the more results button. 32 if (isAllLast) { 33 nextQuestion.find(".program-finder-content__button").removeClass("d-none"); 34 } 35 } 36 else { 37 currentSubmit.removeClass("d-none"); 38 } 39 } 40 } 41})(jQuery, Drupal);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.