File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ var EventType;
2525 * @class
2626 * @author Baptiste Donaux <baptiste.donaux@gmail.com> @baptistedonaux
2727 */
28- var AutoComplete = ( function ( ) {
28+ var AutoComplete = /** @class */ ( function ( ) {
2929 // Constructor
3030 function AutoComplete ( params , selector ) {
3131 if ( params === void 0 ) { params = { } ; }
@@ -302,6 +302,9 @@ var AutoComplete = (function () {
302302 this . _Open ( ) ;
303303 } . bind ( this ) ) ;
304304 }
305+ else {
306+ this . _Close ( ) ;
307+ }
305308 } ,
306309 Operator : ConditionOperator . AND ,
307310 Event : EventType . KEYUP
@@ -385,7 +388,7 @@ var AutoComplete = (function () {
385388 _Blur : function ( now ) {
386389 if ( now === void 0 ) { now = false ; }
387390 if ( now ) {
388- this . DOMResults . setAttribute ( "class" , "autocomplete" ) ;
391+ this . _Close ( ) ;
389392 }
390393 else {
391394 var params = this ;
@@ -422,6 +425,9 @@ var AutoComplete = (function () {
422425 }
423426 } ) ;
424427 } ,
428+ _Close : function ( ) {
429+ this . DOMResults . setAttribute ( "class" , "autocomplete" ) ;
430+ } ,
425431 /**
426432 * Position the results HTML element
427433 */
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ interface Params {
3939 _Limit : any ;
4040 _MinChars : any ;
4141 _Open : any ;
42+ _Close : any ;
4243 _Position : any ;
4344 _Post : any ;
4445 _Pre : any ;
@@ -225,6 +226,8 @@ class AutoComplete {
225226 } . bind ( this ) ,
226227 this . _Error
227228 ) ;
229+ } else {
230+ this . _Close ( ) ;
228231 }
229232 } ,
230233 Operator : ConditionOperator . AND ,
@@ -327,7 +330,7 @@ class AutoComplete {
327330 */
328331 _Blur : function ( now : boolean = false ) : void {
329332 if ( now ) {
330- this . DOMResults . setAttribute ( "class" , "autocomplete" ) ;
333+ this . _Close ( ) ;
331334 } else {
332335 var params = this ;
333336 setTimeout ( function ( ) {
@@ -368,6 +371,10 @@ class AutoComplete {
368371 } ) ;
369372 } ,
370373
374+ _Close : function ( ) : void {
375+ this . DOMResults . setAttribute ( "class" , "autocomplete" ) ;
376+ } ,
377+
371378 /**
372379 * Position the results HTML element
373380 */
You can’t perform that action at this time.
0 commit comments