File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 13691369
13701370 this . selection
13711371 . find ( "span" )
1372- . html ( this . opts . formatSelection ( data ) ) ;
1372+ . empty ( ) . append ( this . opts . formatSelection ( data ) ) ;
13731373
13741374 this . selection . removeClass ( "select2-default" ) ;
13751375
16981698 addSelectedChoice : function ( data ) {
16991699 var choice ,
17001700 id = this . id ( data ) ,
1701- //span.formatSelection is only temporary
1701+
17021702 parts = [ "<li class='select2-search-choice'>" ,
1703- "<span class='formatSelection '></span>" ,
1703+ "<span class='select2-tmp '></span>" ,
17041704 "<a href='javascript:void(0)' class='select2-search-choice-close' tabindex='-1'></a>" ,
17051705 "</li>"
17061706 ] ,
17071707 val = this . getVal ( ) ;
17081708
17091709 choice = $ ( parts . join ( "" ) ) ;
1710- // replace span.formatSelection with the returned value of this.opts.formatSelection(data)
1711- // allows the possibility to return jQuery objects with formatSelection
1712- choice . find ( '.formatSelection' ) . replaceWith ( this . opts . formatSelection ( data ) ) ;
1710+
1711+ choice . find ( '.select2-tmp' ) . replaceWith ( this . opts . formatSelection ( data ) ) ;
17131712 choice . find ( ".select2-search-choice-close" )
17141713 . bind ( "click dblclick" , this . bind ( function ( e ) {
17151714 if ( ! this . enabled ) return ;
You can’t perform that action at this time.
0 commit comments