{"version":3,"sources":["ucws_common/ucws_undergraduate_cost/templates/js/ucws_undergraduate_cost.js"],"names":["$","Drupal","behaviors","UGCostFilters","attach","context","settings","dependentMealPlanDropdowns","attr","selectpicker","removeAttr","width","dropupAuto","change","prop","jQuery"],"mappings":"CAAA,SAAWA,GAGPC,OAAOC,UAAUC,cAAgB,CAC7BC,OAAQ,SAAUC,EAASC,GACvB,IAAIC,EAA6B,WACgB,QAAzCP,EAAE,qBAAqBQ,KAAK,UAC5BR,EAAE,wCAAwCQ,KAAK,WAAY,YAC3DR,EAAE,qBAAqBS,aAAa,MAAO,CAAC,UAG9CT,EAAE,wCAAwCU,WAAW,YACrDV,EAAE,qBAAqBS,aAAa,MAAO,CAAC,QAQ9CT,EAAE,qBAAqBS,aAAa,WACpCT,EAAE,qBAAqBS,aAAa,CAClCE,MAAO,OACPC,YAAY,KAKlBL,IAEAP,EAAE,qBAAqBa,QACnB,WACIb,EAAE,4BAA4Bc,KAAK,YAAY,GAC/CP,SAjCpB,CAsCGQ","file":"ucws_undergraduate_cost.js","sourcesContent":["(function ($) {\n\n //Dependent dropdowns function\n Drupal.behaviors.UGCostFilters = {\n attach: function (context, settings) {\n var dependentMealPlanDropdowns = function () {\n if ($(\"#residence button\").attr('title') === 'Yes') {\n $(\"#meal-plan select option[value='No']\").attr('disabled', 'disabled');\n $('#meal-plan select').selectpicker('val', ['Yes']);\n }\n else {\n $(\"#meal-plan select option[value='No']\").removeAttr('disabled');\n $('#meal-plan select').selectpicker('val', ['No']);\n }\n\n // Refresh dropdowns\n // $('.selectpicker').selectpicker('refresh');\n\n // @todo: Bootstrap Select v1.14.0-beta3 has a bug preventing refresh\n // https://github.com/snapappointments/bootstrap-select/issues/2738\n $('#meal-plan select').selectpicker('destroy');\n $('#meal-plan select').selectpicker({\n width: '100%',\n dropupAuto: false\n });\n };\n\n // On page load or refresh\n dependentMealPlanDropdowns();\n // Select list changes\n $(\"#residence select\").change(\n function () {\n $(\"#meal-plan select option\").prop('disabled', false);\n dependentMealPlanDropdowns();\n }\n );\n }\n };\n})(jQuery);\n\n"]}