Skip to content

Added enableClickableOptGroups option#388

Merged
davidstutz merged 1 commit intodavidstutz:masterfrom
scenting:master
Oct 13, 2014
Merged

Added enableClickableOptGroups option#388
davidstutz merged 1 commit intodavidstutz:masterfrom
scenting:master

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