selectr
selectr copied to clipboard
From 'DeselectOption' to Select All Option
Selectr.DeselectOption = function(opt) {
var currentSelectionCount, el;
el = $(opt).parents('.selectr').prev();
$(opt).parents('.selectr').removeClass('max-selection-reached');
$(opt).removeClass('selected');
$("option[value=" + ($(opt).data('val')) + "]", el).prop('selected', false);
currentSelectionCount = $('option:selected', el).length;
$('.current-selection', $(opt).parents('.selectr')).text(currentSelectionCount > 0 ? currentSelectionCount : '');
return this.TriggerChange(el);
};
This funcions deselect all the options.
How would like to change this functionality to select all options
. Can someone give me a hand?
Thanks