File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -789,17 +789,19 @@ the specific language governing permissions and limitations under the Apache Lic
789789 if ( opts . createSearchChoice === undefined ) {
790790 opts . createSearchChoice = function ( term ) { return { id : term , text : term } ; } ;
791791 }
792- opts . initSelection = function ( element , callback ) {
793- var data = [ ] ;
794- $ ( splitVal ( element . val ( ) , opts . separator ) ) . each ( function ( ) {
795- var id = this , text = this , tags = opts . tags ;
796- if ( $ . isFunction ( tags ) ) tags = tags ( ) ;
797- $ ( tags ) . each ( function ( ) { if ( equal ( this . id , id ) ) { text = this . text ; return false ; } } ) ;
798- data . push ( { id : id , text : text } ) ;
799- } ) ;
800-
801- callback ( data ) ;
802- } ;
792+ if ( opts . initSelection === undefined ) {
793+ opts . initSelection = function ( element , callback ) {
794+ var data = [ ] ;
795+ $ ( splitVal ( element . val ( ) , opts . separator ) ) . each ( function ( ) {
796+ var id = this , text = this , tags = opts . tags ;
797+ if ( $ . isFunction ( tags ) ) tags = tags ( ) ;
798+ $ ( tags ) . each ( function ( ) { if ( equal ( this . id , id ) ) { text = this . text ; return false ; } } ) ;
799+ data . push ( { id : id , text : text } ) ;
800+ } ) ;
801+
802+ callback ( data ) ;
803+ } ;
804+ }
803805 }
804806 }
805807 }
You can’t perform that action at this time.
0 commit comments