File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 59
59
// rewrite internal _toggleChecked fn so that when checkAll/uncheckAll is fired,
60
60
// only the currently filtered elements are checked
61
61
instance . _toggleChecked = function ( flag , group ) {
62
- var $inputs = ( group && group . length ) ?
63
- group :
64
- this . labels . find ( 'input' ) ,
65
-
66
- _self = this ,
67
-
68
- // do not include hidden elems if the menu isn't open.
69
- selector = self . instance . _isOpen ?
70
- ":disabled, :hidden" :
71
- ":disabled" ;
62
+ var $inputs = ( group && group . length ) ? group : this . labels . find ( 'input' ) ;
63
+ var _self = this ;
64
+ // do not include hidden elems if the menu isn't open.
65
+ var selector = self . instance . _isOpen ? ":disabled, :hidden" : ":disabled" ;
72
66
73
- $inputs = $inputs . not ( selector ) . each ( this . _toggleState ( 'checked' , flag ) ) ;
67
+ $inputs = $inputs
68
+ . not ( selector )
69
+ . each ( this . _toggleState ( 'checked' , flag ) ) ;
74
70
75
71
// update text
76
72
this . update ( ) ;
77
73
78
- // figure out which option tags need to be selected
74
+ // gather an array of the values that actually changed
79
75
var values = $inputs . map ( function ( ) {
80
76
return this . value ;
81
77
} ) . get ( ) ;
88
84
_self . _toggleState ( 'selected' , flag ) . call ( this ) ;
89
85
}
90
86
} ) ;
87
+
88
+ // trigger the change event on the select
89
+ if ( $inputs . length ) {
90
+ this . element . trigger ( "change" ) ;
91
+ }
91
92
} ;
92
93
93
94
// rebuild cache when multiselect is updated
You can’t perform that action at this time.
0 commit comments