File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 6363 var _self = this ;
6464
6565 // do not include hidden elems if the menu isn't open.
66- var selector = instance . _isOpen ? ':disabled, :hidden' : ':disabled' ;
66+ var selector = _self . _isOpen ? ':disabled, :hidden' : ':disabled' ;
6767
6868 $inputs = $inputs
6969 . not ( selector )
9191 } ;
9292
9393 // rebuild cache when multiselect is updated
94- var doc = $ ( document ) . bind ( 'multiselectrefresh' , $ . proxy ( function ( ) {
94+ var doc = $ ( document ) . bind ( 'multiselectrefresh.' + instance . _namespaceID , $ . proxy ( function ( ) {
9595 this . updateCache ( ) ;
9696 this . _handler ( ) ;
9797 } , this ) ) ;
9898
9999 // automatically reset the widget on close?
100100 if ( this . options . autoReset ) {
101- doc . bind ( 'multiselectclose' , $ . proxy ( this . _reset , this ) ) ;
101+ doc . bind ( 'multiselectclose.' + instance . _namespaceID , $ . proxy ( this . _reset , this ) ) ;
102102 }
103103 } ,
104104
Original file line number Diff line number Diff line change 3636 noneSelectedText : 'Select options' ,
3737 selectedText : '# selected' ,
3838 selectedList : 0 ,
39+ closeIcon : 'ui-icon ui-icon-circle-close' ,
3940 show : null ,
4041 hide : null ,
4142 autoOpen : false ,
8687 return '' ;
8788 }
8889 } )
89- . append ( '<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close "></span></a></li>' )
90+ . append ( '<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="' + o . closeIcon + ' "></span></a></li>')
9091 . appendTo ( header ) ,
9192
9293 checkboxContainer = ( this . checkboxContainer = $ ( '<ul />' ) )
417418 // restored to their defaultValue prop on form reset, and the reset
418419 // handler fires before the form is actually reset. delaying it a bit
419420 // gives the form inputs time to clear.
420- $ ( this . element [ 0 ] . form ) . bind ( 'reset.multiselect' , function ( ) {
421+ $ ( this . element [ 0 ] . form ) . bind ( 'reset.' + this . _namespaceID , function ( ) {
421422 setTimeout ( $ . proxy ( self . refresh , self ) , 10 ) ;
422423 } ) ;
423424 } ,
438439 // set menu width
439440 _setMenuWidth : function ( ) {
440441 var m = this . menu ;
441- m . outerWidth ( this . button . outerWidth ( ) ) ;
442+ var width = ( this . button . outerWidth ( ) <= 0 ) ? this . options . minWidth : this . button . outerWidth ( ) ;
443+ m . outerWidth ( width ) ;
442444 } ,
443445
444446 // move up or down within the menu
644646
645647 // unbind events
646648 $doc . unbind ( this . _namespaceID ) ;
649+ $ ( this . element [ 0 ] . form ) . unbind ( this . _namespaceID ) ;
647650
648651 this . button . remove ( ) ;
649652 this . menu . remove ( ) ;
You can’t perform that action at this time.
0 commit comments