File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9393 nextUid = ( function ( ) { var counter = 1 ; return function ( ) { return counter ++ ; } ; } ( ) ) ;
9494
9595 function escapeMarkup ( markup ) {
96- if ( typeof ( markup ) === "string" ) {
96+ if ( markup && typeof ( markup ) === "string" ) {
9797 return markup . replace ( "&" , "&" ) ;
9898 } else {
9999 return markup ;
393393 */
394394 $ ( document ) . ready ( function ( ) {
395395 $ ( document ) . delegate ( "*" , "mousedown touchend" , function ( e ) {
396- var target = $ ( e . target ) . closest ( "div.select2-container" ) . get ( 0 ) ;
396+ var target = $ ( e . target ) . closest ( "div.select2-container" ) . get ( 0 ) , attr ;
397397 if ( target ) {
398398 $ ( document ) . find ( "div.select2-container-active" ) . each ( function ( ) {
399399 if ( this !== target ) $ ( this ) . data ( "select2" ) . blur ( ) ;
406406 }
407407
408408 target = $ ( e . target ) ;
409- if ( "LABEL" === e . target . tagName && target . attr ( "for" ) . length > 0 ) {
410- target = $ ( "#" + target . attr ( "for" ) ) ;
409+ attr = target . attr ( "for" ) ;
410+ if ( "LABEL" === e . target . tagName && attr && attr . length > 0 ) {
411+ target = $ ( "#" + attr ) ;
411412 target = target . data ( "select2" ) ;
412413 if ( target !== undefined ) { target . focus ( ) ; e . preventDefault ( ) ; }
413414 }
You can’t perform that action at this time.
0 commit comments