@@ -765,21 +765,7 @@ define('select2/keys',[
765765 UP : 38 ,
766766 RIGHT : 39 ,
767767 DOWN : 40 ,
768- DELETE : 46 ,
769-
770- isArrow : function ( k ) {
771- k = k . which ? k . which : k ;
772-
773- switch ( k ) {
774- case KEY . LEFT :
775- case KEY . RIGHT :
776- case KEY . UP :
777- case KEY . DOWN :
778- return true ;
779- }
780-
781- return false ;
782- }
768+ DELETE : 46
783769 } ;
784770
785771 return KEYS ;
@@ -1164,7 +1150,7 @@ define('select2/selection/allowClear',[
11641150 decorated . call ( this , container , $container ) ;
11651151
11661152 if ( self . placeholder == null ) {
1167- if ( console && console . error ) {
1153+ if ( window . console && console . error ) {
11681154 console . error (
11691155 'Select2: The `allowClear` option should be used in combination ' +
11701156 'with the `placeholder` option.'
@@ -2385,7 +2371,7 @@ define('select2/data/select',[
23852371 data . push . apply ( data , currentData ) ;
23862372
23872373 for ( var d = 0 ; d < data . length ; d ++ ) {
2388- id = data [ d ] . id ;
2374+ var id = data [ d ] . id ;
23892375
23902376 if ( val . indexOf ( id ) === - 1 ) {
23912377 val . push ( id ) ;
@@ -2423,7 +2409,7 @@ define('select2/data/select',[
24232409 var val = [ ] ;
24242410
24252411 for ( var d = 0 ; d < currentData . length ; d ++ ) {
2426- id = currentData [ d ] . id ;
2412+ var id = currentData [ d ] . id ;
24272413
24282414 if ( id !== data . id && val . indexOf ( id ) === - 1 ) {
24292415 val . push ( id ) ;
@@ -2759,7 +2745,7 @@ define('select2/data/ajax',[
27592745 var $request = options . transport ( options , function ( data ) {
27602746 var results = self . processResults ( data , params ) ;
27612747
2762- if ( console && console . error ) {
2748+ if ( window . console && console . error ) {
27632749 // Check to make sure that the response included a `results` key.
27642750 if ( ! results || ! results . results || ! $ . isArray ( results . results ) ) {
27652751 console . error (
@@ -3428,7 +3414,7 @@ define('select2/dropdown/attachBody',[
34283414 var resizeEvent = 'resize.select2.' + container . id ;
34293415 var orientationEvent = 'orientationchange.select2.' + container . id ;
34303416
3431- $watchers = this . $container . parents ( ) . filter ( Utils . hasScroll ) ;
3417+ var $watchers = this . $container . parents ( ) . filter ( Utils . hasScroll ) ;
34323418 $watchers . each ( function ( ) {
34333419 $ ( this ) . data ( 'select2-scroll-position' , {
34343420 x : $ ( this ) . scrollLeft ( ) ,
@@ -3453,7 +3439,7 @@ define('select2/dropdown/attachBody',[
34533439 var resizeEvent = 'resize.select2.' + container . id ;
34543440 var orientationEvent = 'orientationchange.select2.' + container . id ;
34553441
3456- $watchers = this . $container . parents ( ) . filter ( Utils . hasScroll ) ;
3442+ var $watchers = this . $container . parents ( ) . filter ( Utils . hasScroll ) ;
34573443 $watchers . off ( scrollEvent ) ;
34583444
34593445 $ ( window ) . off ( scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent ) ;
@@ -3545,7 +3531,7 @@ define('select2/dropdown/minimumResultsForSearch',[
35453531
35463532] , function ( ) {
35473533 function countResults ( data ) {
3548- count = 0 ;
3534+ var count = 0 ;
35493535
35503536 for ( var d = 0 ; d < data . length ; d ++ ) {
35513537 var item = data [ d ] ;
@@ -3918,7 +3904,7 @@ define('select2/defaults',[
39183904 // The translation could not be loaded at all. Sometimes this is
39193905 // because of a configuration problem, other times this can be
39203906 // because of how Select2 helps load all possible translation files.
3921- if ( console && console . warn ) {
3907+ if ( window . console && console . warn ) {
39223908 console . warn (
39233909 'Select2: The lanugage file for "' + name + '" could not be ' +
39243910 'automatically loaded. A fallback will be used instead.'
@@ -4085,7 +4071,7 @@ define('select2/options',[
40854071 $e . prop ( 'multiple' , this . options . multiple ) ;
40864072
40874073 if ( $e . data ( 'select2-tags' ) ) {
4088- if ( console && console . warn ) {
4074+ if ( window . console && console . warn ) {
40894075 console . warn (
40904076 'Select2: The `data-select2-tags` attribute has been changed to ' +
40914077 'use the `data-data` and `data-tags="true"` attributes and will be ' +
@@ -4098,7 +4084,7 @@ define('select2/options',[
40984084 }
40994085
41004086 if ( $e . data ( 'ajax-url' ) ) {
4101- if ( console && console . warn ) {
4087+ if ( window . console && console . warn ) {
41024088 console . warn (
41034089 'Select2: The `data-ajax-url` attribute has been changed to ' +
41044090 '`data-ajax--url` and support for the old attribute will be removed' +
@@ -4284,8 +4270,8 @@ define('select2/core',[
42844270
42854271 var attrs = style . split ( ';' ) ;
42864272
4287- for ( i = 0 , l = attrs . length ; i < l ; i = i + 1 ) {
4288- attr = attrs [ i ] . replace ( / \s / g, '' ) ;
4273+ for ( var i = 0 , l = attrs . length ; i < l ; i = i + 1 ) {
4274+ var attr = attrs [ i ] . replace ( / \s / g, '' ) ;
42894275 var matches = attr . match ( WIDTH ) ;
42904276
42914277 if ( matches !== null && matches . length >= 1 ) {
@@ -4532,7 +4518,7 @@ define('select2/core',[
45324518 } ;
45334519
45344520 Select2 . prototype . enable = function ( args ) {
4535- if ( console && console . warn ) {
4521+ if ( window . console && console . warn ) {
45364522 console . warn (
45374523 'Select2: The `select2("enable")` method has been deprecated and will' +
45384524 ' be removed in later Select2 versions. Use $element.prop("disabled")' +
@@ -4550,7 +4536,7 @@ define('select2/core',[
45504536 } ;
45514537
45524538 Select2 . prototype . data = function ( ) {
4553- if ( arguments . length > 0 && console && console . warn ) {
4539+ if ( arguments . length > 0 && window . console && console . warn ) {
45544540 console . warn (
45554541 'Select2: Data can no longer be set using `select2("data")`. You ' +
45564542 'should consider setting the value instead using `$element.val()`.'
@@ -4567,7 +4553,7 @@ define('select2/core',[
45674553 } ;
45684554
45694555 Select2 . prototype . val = function ( args ) {
4570- if ( console && console . warn ) {
4556+ if ( window . console && console . warn ) {
45714557 console . warn (
45724558 'Select2: The `select2("val")` method has been deprecated and will be' +
45734559 ' removed in later Select2 versions. Use $element.val() instead.'
@@ -4911,7 +4897,7 @@ define('select2/compat/initSelection',[
49114897 'jquery'
49124898] , function ( $ ) {
49134899 function InitSelection ( decorated , $element , options ) {
4914- if ( console && console . warn ) {
4900+ if ( window . console && console . warn ) {
49154901 console . warn (
49164902 'Select2: The `initSelection` option has been deprecated in favor' +
49174903 ' of a custom data adapter that overrides the `current` method. ' +
@@ -4954,7 +4940,7 @@ define('select2/compat/query',[
49544940
49554941] , function ( ) {
49564942 function Query ( decorated , $element , options ) {
4957- if ( console && console . warn ) {
4943+ if ( window . console && console . warn ) {
49584944 console . warn (
49594945 'Select2: The `query` option has been deprecated in favor of a ' +
49604946 'custom data adapter that overrides the `query` method. Support ' +
0 commit comments