lou/multi-select — pull request #21 by top-flight (2011-12-05 00:40:31+00:00)
Title: optgroup bug fix

Fixes two things for optgroup functionality:

If you are using optgroups and an item is in the 'selected' list, make sure it doesn't ever show in the 'selectable' list unless it gets trashed.

If you trash a 'selected' item and the optgroup it belongs to is collapsed, make sure it expands so if you re-select the item the plugin will still work correctly.

To reproduce:
Reproduce Optgroup bug one:
1. Expand some option group.
2. Select an option so it sits in the 'selected' list.
3. Collapse the option group.
4. Trash your selected item.

The option group the trashed item belongs to is still collapsed and the item is sitting under it.

Reproduce Optgroup bug two (this is a bug in the example code and not the lib):
1. Expand some option group.
2. Select an option so it sits in the 'selected' list.
3. Collapse the option group.
4. Expand the option group.
5. The 'selected' option reappears in the 'selectable' list but it should not be there.