File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,12 +131,34 @@ $.widget("ui.multiselect", {
131131 return false ;
132132 } ) ;
133133 } ,
134+
135+ refresh : function ( ) {
136+
137+ // reset dimensions
138+ this . _setDimensions ( ) ;
139+
140+ } ,
141+
134142 destroy : function ( ) {
135143 this . element . show ( ) ;
136144 this . container . remove ( ) ;
137145
138146 $ . Widget . prototype . destroy . apply ( this , arguments ) ;
139147 } ,
148+
149+ _setDimensions : function ( ) {
150+
151+ // set dimensions
152+ this . container . width ( this . element . width ( ) + 1 ) ;
153+ this . selectedContainer . width ( Math . floor ( this . element . width ( ) * this . options . dividerLocation ) ) ;
154+ this . availableContainer . width ( Math . floor ( this . element . width ( ) * ( 1 - this . options . dividerLocation ) ) ) ;
155+
156+ // fix list height to match <option> depending on their individual header's heights
157+ this . selectedList . height ( Math . max ( this . element . height ( ) - this . selectedActions . height ( ) , 1 ) ) ;
158+ this . availableList . height ( Math . max ( this . element . height ( ) - this . availableActions . height ( ) , 1 ) ) ;
159+
160+ } ,
161+
140162 _populateLists : function ( options ) {
141163 this . selectedList . children ( '.ui-element' ) . remove ( ) ;
142164 this . availableList . children ( '.ui-element' ) . remove ( ) ;
You can’t perform that action at this time.
0 commit comments