Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added enableClickableOptGroups option #388

Merged
merged 1 commit into from
Oct 13, 2014
Merged

Conversation

scenting
Copy link
Contributor

Very similar to #305 but without creating random ids to identify groups.

@davidstutz
Copy link
Owner

Just for reference: #305, #302.

Thanks!

davidstutz added a commit that referenced this pull request Oct 13, 2014
#305, #302. Added enableClickableOptGroups option.
@davidstutz davidstutz merged commit fb70b2a into davidstutz:master Oct 13, 2014
@markusd1984
Copy link

@davidstutz Is it possible to use this for just clickable headers without selecting all?

I'd like to have clickable headers for single select groups as its much easier than trying to click the little caret on the right. =)

@markusd1984
Copy link

markusd1984 commented Dec 1, 2022

I've added another similar setting enableClickableOptGroupsSingle: false, to #305, to allow for clickable headers for single select which is much easier to click than the carret on the very right.

if (this.options.enableClickableOptGroupsSingle) {
                $groupOption.addClass("multiselect-group-header");
                $groupOption.html(" " + label);
            }
if (this.options.enableClickableOptGroupsSingle /*&& this.options.multiple*/) {
                $(".multiselect-group-header", this.$popupContainer).off("click");
                $(".multiselect-group-header", this.$popupContainer).on("click", $.proxy(function (event) {
                    var $group = $(event.target).closest('.multiselect-group');
                    var $inputs = $group.nextUntil(".multiselect-group")
                        .not('.multiselect-filter-hidden');

                    var visible = true;
                    $inputs.each(function () {
                        visible = visible && !$(this).hasClass('multiselect-collapsible-hidden');
                    });

                    if (visible) {
                        $inputs.hide()
                            .addClass('multiselect-collapsible-hidden');
                    }
                    else {
                        $inputs.show()
                            .removeClass('multiselect-collapsible-hidden');
                    }
                }, this));
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants