ehynds / jquery-ui-multiselect-widget

jQuery UI MultiSelect widget
GNU General Public License v2.0
1.37k stars 693 forks source link

Introduce state class for when any item is selected. #841

Closed rasben closed 5 years ago

rasben commented 5 years ago

What changes are you proposing? Why are they needed?

Adding a class to the button when any value is selected.

The usecase of this for me is so I can style the button to have a "placeholder" styling. Technically it's not a placeholder, but you get the point :)

Pull Request Approval Checklist:

rasben commented 5 years ago

Here's an example of how I'm using it:

Screenshot 2019-03-14 at 19 33 14

The one on the left is selected state, the one on the right is unselected

mlh758 commented 5 years ago

This looks fine to me. Could you add a test for it?

rasben commented 5 years ago

Sure, but can you nudge me in the right direction of where/how I'd add that test? @mlh758 :)

mlh758 commented 5 years ago

I think an easy way would be to add another expectation to the checkAll method here.

Just make sure your class is set on it. Then on uncheckAll make sure your class is no longer set on it.