diff --git a/wdn/templates_4.1/scripts/wdn-ui.js b/wdn/templates_4.1/scripts/wdn-ui.js index 4334cb757..2a3dade8e 100644 --- a/wdn/templates_4.1/scripts/wdn-ui.js +++ b/wdn/templates_4.1/scripts/wdn-ui.js @@ -12,15 +12,15 @@ define(['jquery'], function($) { $(element).attr('checked', false); }); }; - + return { initialize : function () { - + if (initd) { //Don't initialize multiple times return; } - + this.setUpDropDownWidget('.wdn-dropdown-widget-toggle'); //Close search on escape @@ -34,18 +34,18 @@ define(['jquery'], function($) { //listen for clicks on the document and close dropdowns if they don't come from a dropdown $(document).on('click', function(e) { var $target = $(e.target); - + //dont close this way if the control was clicked if ($target.filter('.wdn-dropdown-widget-toggle, .wdn-dropdown-widget-label').length) { return; } - + //close all dropdown widgets if (!$('.wdn-dropdown-widget-content').find(e.target).length) { closeDropDown('.wdn-dropdown-widget-toggle'); } }); - + initd = true; }, @@ -65,15 +65,15 @@ define(['jquery'], function($) { //Get the dropdown-container for this control. var container_id = $element.attr('aria-controls'); var $container = $('#'+container_id); - + //Mark it as hidden $container.attr('aria-hidden', true); - + //Add a helper class to labels var $label = $('label[for="'+$element.attr('id')+'"]'); $label.addClass('wdn-dropdown-widget-label'); }); - + $(selector).change(function() { var $control = $(this); if ($control.is(':checked')) {