File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1932,15 +1932,14 @@ the specific language governing permissions and limitations under the Apache Lic
19321932
19331933 if ( opts . element . get ( 0 ) . tagName . toLowerCase ( ) === "select" ) {
19341934 // install sthe selection initializer
1935- opts . initSelection = function ( element , callback ) {
1935+ opts . initSelection = function ( element , callback ) {
19361936
19371937 var data = [ ] ;
1938+
19381939 element . find ( ":selected" ) . each2 ( function ( i , elm ) {
1939- data . push ( { id : elm . attr ( "value" ) , text : elm . text ( ) , element : elm } ) ;
1940+ data . push ( { id : elm . attr ( "value" ) , text : elm . text ( ) , element : elm [ 0 ] } ) ;
19401941 } ) ;
1941-
1942- if ( $ . isFunction ( callback ) )
1943- callback ( data ) ;
1942+ callback ( data ) ;
19441943 } ;
19451944 } else if ( "data" in opts ) {
19461945 // install default initSelection when applied to hidden input and data is local
@@ -2410,10 +2409,7 @@ the specific language governing permissions and limitations under the Apache Lic
24102409 this . setVal ( val ) ;
24112410
24122411 if ( this . select ) {
2413- this . select . find ( ":selected" ) . each ( function ( ) {
2414- data . push ( { id : $ ( this ) . attr ( "value" ) , text : $ ( this ) . text ( ) } ) ;
2415- } ) ;
2416- this . updateSelection ( data ) ;
2412+ this . opts . initSelection ( this . select , this . bind ( this . updateSelection ) ) ;
24172413 if ( triggerChange ) {
24182414 this . triggerChange ( ) ;
24192415 }
You can’t perform that action at this time.
0 commit comments