From 862f824d6475606f2d6e1d332680bd5141d74934 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 22 Feb 2012 21:38:15 +0100 Subject: [PATCH] some multiselect improvements --- core/js/multiselect.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/core/js/multiselect.js b/core/js/multiselect.js index 96fc09a075..541dddf0f7 100644 --- a/core/js/multiselect.js +++ b/core/js/multiselect.js @@ -12,6 +12,11 @@ 'minWidth': 'default;', }; $.extend(settings,options); + $.each(this.children(),function(i,option){ + if($(option).attr('selected') && settings.checked.indexOf($(option).val())==-1){ + settings.checked.push($(option).val()); + } + }); var button=$('
'+settings.title+'
'); var span=$(''); span.append(button); @@ -46,9 +51,11 @@ }); button.addClass('active'); event.stopPropagation(); - var options=$(this).parent().next().children().map(function(){return $(this).val();}); + var options=$(this).parent().next().children(); var list=$('