1(function ($, Drupal) { 2 Drupal.behaviors.regionSelected = { 3 attach: function (context, settings) { 4 var $context = $(context); 5 var self = this; 6 7 // $context.find('#edit-region').trigger('change'); 8 $context.find('#edit-region').on('change', function() { 9 var $regionSelector = $(this); 10 var link = drupalSettings.idsp_base.regions[$regionSelector.val()]; 11 12 if (link && link.length) { 13 window.location.href = link; 14 } 15 16 // self.enableRegionSelect($context, $regionSelector.val()); 17 //var $selectList = $context.find("#" + $regionSelector.val() + "_subregion_select"); 18 }); 19 }, 20 hideAll: function(context) { 21 var $context = $(context); 22 $context.find(".form-item-district").addClass('hidden'); 23 $context.find(".subregion-select").parent().addClass('hidden'); 24 }, 25 enableRegionSelect: function(context, region) { 26 var $context = $(context); 27 28 $context.find(".subregion-select").each(function(index) { 29 var $item = $(this); 30 $item.attr('name', $item.attr('id')); 31 }); 32 33 $context.find(".subregion-container").addClass("hidden"); 34 35 $context.find("#" + region + "_subregions") 36 .removeClass('hidden'); 37 38 $context.find("#" + region + "_subregion_select") 39 .attr('name', 'district'); 40 } 41 } 42})(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.