summaryrefslogtreecommitdiffstats
path: root/js/jquery.multi-select.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r--js/jquery.multi-select.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index ad5863f..56695de 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -203,10 +203,20 @@
}
}
},
- 'select_all' : function(){
- var ms = this;
+ 'select_all' : function(visible){
+ var ms = this,
+ selectableUl = $('#ms-'+ms.attr('id')+' .ms-selectable ul');
+
ms.find("option:not(option[value=''])").each(function(){
- ms.multiSelect('select', $(this).val(), 'select_all');
+ var value = $(this).val();
+ if (visible){
+ var selectableLi = selectableUl.children('li[ms-value="'+value+'"]');
+ if (selectableLi.filter(':visible').length > 0){
+ ms.multiSelect('select', value, 'select_all');
+ }
+ } else {
+ ms.multiSelect('select', value, 'select_all');
+ }
});
},
'deselect_all' : function(){