dist/lumx.js
function toggleChoice(choice, evt) {
            if (lxSelect.multiple && !lxSelect.autocomplete && angular.isDefined(evt)) {
                evt.stopPropagation();
            }

            if (lxSelect.areChoicesOpened() && lxSelect.multiple) {
                var dropdownElement = angular.element(angular.element(evt.target).closest('.dropdown-menu--is-open')[0]);
                // If the dropdown element is scrollable, fix the content div height to keep the current scroll state.
                if (dropdownElement.scrollTop() > 0) {
                    var dropdownContentElement = angular.element(dropdownElement.find('.dropdown-menu__content')[0]);
                    var dropdownFilterElement = angular.element(dropdownContentElement.find('.lx-select-choices__filter')[0]);

                    var newHeight = dropdownContentElement.height();
                    newHeight -= (dropdownFilterElement.length) ? dropdownFilterElement.outerHeight() : 0;

                    var dropdownListElement = angular.element(dropdownContentElement.find('ul > div')[0]);
                    dropdownListElement.css('height', newHeight + 'px');

                    // This function is called when the ng-change attached to the filter input is called.
                    lxSelect.resetDropdownSize = function() {
                        dropdownListElement.css('height', 'auto');
                        lxSelect.resetDropdownSize = undefined;
                    }
                }
            }

            if (lxSelect.multiple && isSelected(choice)) {
                lxSelect.unselect(choice);
            } else {
                lxSelect.select(choice);
            }

            if (lxSelect.autocomplete) {
                lxSelect.activeChoiceIndex = -1;
                lxSelect.filterModel = undefined;
            }

            if (lxSelect.autocomplete || (lxSelect.choicesViewMode === 'panes' && !lxSelect.multiple)) {
                LxDropdownService.close('dropdown-' + lxSelect.uuid);
            }
        }
function toggleChoice(choice, evt) {
            if (lxSelect.multiple && !lxSelect.autocomplete && angular.isDefined(evt)) {
                evt.stopPropagation();
            }

            if (lxSelect.areChoicesOpened() && lxSelect.multiple) {
                var dropdownElement = angular.element(angular.element(evt.target).closest('.dropdown-menu--is-open')[0]);
                // If the dropdown element is scrollable, fix the content div height to keep the current scroll state.
                if (dropdownElement.scrollTop() > 0) {
                    var dropdownContentElement = angular.element(dropdownElement.find('.dropdown-menu__content')[0]);
                    var dropdownFilterElement = angular.element(dropdownContentElement.find('.lx-select-choices__filter')[0]);

                    var newHeight = dropdownContentElement.height();
                    newHeight -= (dropdownFilterElement.length) ? dropdownFilterElement.outerHeight() : 0;

                    var dropdownListElement = angular.element(dropdownContentElement.find('ul > div')[0]);
                    dropdownListElement.css('height', newHeight + 'px');

                    // This function is called when the ng-change attached to the filter input is called.
                    lxSelect.resetDropdownSize = function() {
                        dropdownListElement.css('height', 'auto');
                        lxSelect.resetDropdownSize = undefined;
                    }
                }
            }

            if (lxSelect.multiple && isSelected(choice)) {
                lxSelect.unselect(choice);
            } else {
                lxSelect.select(choice);
            }

            if (lxSelect.autocomplete) {
                lxSelect.activeChoiceIndex = -1;
                lxSelect.filterModel = undefined;
            }

            if (lxSelect.autocomplete || (lxSelect.choicesViewMode === 'panes' && !lxSelect.multiple)) {
                LxDropdownService.close('dropdown-' + lxSelect.uuid);
            }
        }
function toggleChoice ( choice , evt ) { if ( lxSelect . multiple && ! lxSelect . autocomplete && angular . isDefined ( evt ) ) { evt . stopPropagation ( ) ; } if ( lxSelect . areChoicesOpened ( ) && lxSelect . multiple ) { var dropdownElement = angular . element ( angular . element ( evt . target ) . closest ( '.dropdown-menu--is-open' ) [ 0 ] ) ; // If the dropdown element is scrollable, fix the content div height to keep the current scroll state. if ( dropdownElement . scrollTop ( ) > 0 ) { var dropdownContentElement = angular . element ( dropdownElement . find ( '.dropdown-menu__content' ) [ 0 ] ) ; var dropdownFilterElement = angular . element ( dropdownContentElement . find ( '.lx-select-choices__filter' ) [ 0 ] ) ; var newHeight = dropdownContentElement . height ( ) ; newHeight -= ( dropdownFilterElement . length ) ? dropdownFilterElement . outerHeight ( ) : 0 ; var dropdownListElement = angular . element ( dropdownContentElement . find ( 'ul > div' ) [ 0 ] ) ; dropdownListElement . css ( 'height' , newHeight + 'px' ) ; // This function is called when the ng-change attached to the filter input is called. lxSelect . resetDropdownSize = function ( ) { dropdownListElement . css ( 'height' , 'auto' ) ; lxSelect . resetDropdownSize = undefined ; } } } if ( lxSelect . multiple && isSelected ( choice ) ) { lxSelect . unselect ( choice ) ; } else { lxSelect . select ( choice ) ; } if ( lxSelect . autocomplete ) { lxSelect . activeChoiceIndex = - 1 ; lxSelect . filterModel = undefined ; } if ( lxSelect . autocomplete || ( lxSelect . choicesViewMode === 'panes' && ! lxSelect . multiple ) ) { LxDropdownService . close ( 'dropdown-' + lxSelect . uuid ) ; } }
Toggle the given choice. If it was selected, unselect it. If it wasn't selected, select it.

@param {Object} choice The choice to toggle.
@param {Event}  [evt]  The event that triggered the function.
Toggle the given choice . If it was selected unselect it . If it wasn t selected select it .