From 6a9a77875f305d7245bf30ec8a6a5ef1e1409290 Mon Sep 17 00:00:00 2001 From: Patrick Springstubbe Date: Tue, 22 May 2018 10:12:14 -0400 Subject: [PATCH] resolves #132 --- CHANGELOG | 4 ++++ bower.json | 2 +- jquery.multiselect.js | 14 +++++--------- package.json | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ff26748..e9d0f71 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2.4.12 (2018-05-22) +=================== +resolves #132 (un/select all) logic with dynamically loaded options + 2.4.11 (2018-03-06) =================== pass selected count to the onSelectAll callback diff --git a/bower.json b/bower.json index 5ecb41c..76939ee 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,7 @@ "author": "nobleclem", "name": "jQuery-MultiSelect", "description": "Turn a multiselect list into a nice and easy to use list with checkboxes", - "version": "2.4.11", + "version": "2.4.12", "main": [ "jquery.multiselect.js", "jquery.multiselect.css" diff --git a/jquery.multiselect.js b/jquery.multiselect.js index c176225..2dfc8be 100644 --- a/jquery.multiselect.js +++ b/jquery.multiselect.js @@ -1,6 +1,6 @@ /** * Display a nice easy to use multiselect list - * @Version: 2.4.11 + * @Version: 2.4.12 * @Author: Patrick Springstubbe * @Contact: @JediNobleclem * @Website: springstubbe.us @@ -447,9 +447,6 @@ }); instance.loadOptions( options, true, false ); - // update un/select all logic - instance._updateSelectAllText( false ); - // BIND SELECT ACTION optionsWrap.on( 'click', 'input[type="checkbox"]', function(){ $(this).closest( 'li' ).toggleClass( 'selected' ); @@ -704,6 +701,9 @@ }); } } + + // update un/select all logic + instance._updateSelectAllText(); }, /* UPDATE MULTISELECT CONFIG OPTIONS */ @@ -753,15 +753,11 @@ /** PRIVATE FUNCTIONS **/ // update the un/select all texts based on selected options and visibility - _updateSelectAllText: function( visibleOnly ){ + _updateSelectAllText: function(){ if( !this.updateSelectAll ) { return; } - if( typeof visibleOnly !== 'boolean' ) { - visibleOnly = true; - } - var instance = this; // select all not used at all so just do nothing diff --git a/package.json b/package.json index 0b1f3ea..0256cba 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "name": "Patrick Springstubbe", "url" : "http://springstubbe.us" }, - "version": "2.4.11", + "version": "2.4.12", "main": "jquery.multiselect.js", "license": "MIT", "keywords": [