diff options
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r-- | js/jquery.multi-select.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index 7ea713e..98f0770 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -88,6 +88,10 @@ (method != 'init' && !selectedOption.attr('selected'))) if (haveToSelect ){ + var parentOptgroup = selectableLi.parent('.ms-optgroup'); + if (parentOptgroup.length > 0) + if (parentOptgroup.children('.ms-elem-selectable:not(:hidden)').length == 1) + parentOptgroup.children('.ms-optgroup-label').hide(); selectableLi.hide(); selectedOption.attr('selected', 'selected'); if(titleAttr){ @@ -121,6 +125,9 @@ selectableLi = selectableUl.children('li[ms-value="'+value+'"]'), selectedLi = selectedUl.children('li[ms-value="'+value+'"]'); + var parentOptgroup = selectableLi.parent('.ms-optgroup'); + if (parentOptgroup.length > 0) + parentOptgroup.children('.ms-optgroup-label').show(); selectedOption.removeAttr('selected'); selectableLi.show(); selectedLi.remove(); |