@@ -24,7 +24,7 @@ var autoComplete = (function(){
2424 // if (el.removeEventListener) not working in IE11
2525 if ( el . detachEvent ) el . detachEvent ( 'on' + type , handler ) ; else el . removeEventListener ( type , handler ) ;
2626 }
27- function live ( event , elClass , cb , context ) {
27+ function live ( elClass , event , cb , context ) {
2828 addEvent ( context || document , event , function ( e ) {
2929 var found , el = e . target || e . srcElement ;
3030 while ( el && ! ( found = hasClass ( el , elClass ) ) ) el = el . parentElement ;
@@ -91,18 +91,18 @@ var autoComplete = (function(){
9191 addEvent ( window , 'resize' , that . updateSC ) ;
9292 document . body . appendChild ( that . sc ) ;
9393
94- live ( 'mouseleave ' , 'autocomplete-suggestion ' , function ( e ) {
94+ live ( 'autocomplete-suggestion ' , 'mouseleave ' , function ( e ) {
9595 var sel = that . sc . querySelector ( '.autocomplete-suggestion.selected' ) ;
9696 if ( sel ) setTimeout ( function ( ) { sel . className = sel . className . replace ( 'selected' , '' ) ; } , 20 ) ;
9797 } , that . sc ) ;
9898
99- live ( 'mouseover ' , 'autocomplete-suggestion ' , function ( e ) {
99+ live ( 'autocomplete-suggestion ' , 'mouseover ' , function ( e ) {
100100 var sel = that . sc . querySelector ( '.autocomplete-suggestion.selected' ) ;
101101 if ( sel ) sel . className = sel . className . replace ( 'selected' , '' ) ;
102102 this . className += ' selected' ;
103103 } , that . sc ) ;
104104
105- live ( 'mouseup ' , 'autocomplete-suggestion ' , function ( e ) {
105+ live ( 'autocomplete-suggestion ' , 'mouseup ' , function ( e ) {
106106 if ( hasClass ( this , 'autocomplete-suggestion' ) ) { // else outside click
107107 var v = this . getAttribute ( 'data-val' ) ;
108108 that . value = v ;
0 commit comments