@@ -24,7 +24,7 @@ var autoComplete = (function(){
24
24
// if (el.removeEventListener) not working in IE11
25
25
if ( el . detachEvent ) el . detachEvent ( 'on' + type , handler ) ; else el . removeEventListener ( type , handler ) ;
26
26
}
27
- function live ( event , elClass , cb , context ) {
27
+ function live ( elClass , event , cb , context ) {
28
28
addEvent ( context || document , event , function ( e ) {
29
29
var found , el = e . target || e . srcElement ;
30
30
while ( el && ! ( found = hasClass ( el , elClass ) ) ) el = el . parentElement ;
@@ -91,18 +91,18 @@ var autoComplete = (function(){
91
91
addEvent ( window , 'resize' , that . updateSC ) ;
92
92
document . body . appendChild ( that . sc ) ;
93
93
94
- live ( 'mouseleave ' , 'autocomplete-suggestion ' , function ( e ) {
94
+ live ( 'autocomplete-suggestion ' , 'mouseleave ' , function ( e ) {
95
95
var sel = that . sc . querySelector ( '.autocomplete-suggestion.selected' ) ;
96
96
if ( sel ) setTimeout ( function ( ) { sel . className = sel . className . replace ( 'selected' , '' ) ; } , 20 ) ;
97
97
} , that . sc ) ;
98
98
99
- live ( 'mouseover ' , 'autocomplete-suggestion ' , function ( e ) {
99
+ live ( 'autocomplete-suggestion ' , 'mouseover ' , function ( e ) {
100
100
var sel = that . sc . querySelector ( '.autocomplete-suggestion.selected' ) ;
101
101
if ( sel ) sel . className = sel . className . replace ( 'selected' , '' ) ;
102
102
this . className += ' selected' ;
103
103
} , that . sc ) ;
104
104
105
- live ( 'mouseup ' , 'autocomplete-suggestion ' , function ( e ) {
105
+ live ( 'autocomplete-suggestion ' , 'mouseup ' , function ( e ) {
106
106
if ( hasClass ( this , 'autocomplete-suggestion' ) ) { // else outside click
107
107
var v = this . getAttribute ( 'data-val' ) ;
108
108
that . value = v ;
0 commit comments