Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dist/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var EventType;
* @class
* @author Baptiste Donaux <baptiste.donaux@gmail.com> @baptistedonaux
*/
var AutoComplete = (function () {
var AutoComplete = /** @class */ (function () {
// Constructor
function AutoComplete(params, selector) {
if (params === void 0) { params = {}; }
Expand Down Expand Up @@ -284,6 +284,9 @@ var AutoComplete = (function () {
this._Open();
}.bind(this));
}
else {
this._Close();
}
},
Operator: ConditionOperator.AND,
Event: EventType.KEYUP
Expand Down Expand Up @@ -367,7 +370,7 @@ var AutoComplete = (function () {
_Blur: function (now) {
if (now === void 0) { now = false; }
if (now) {
this.DOMResults.setAttribute("class", "autocomplete");
this._Close();
}
else {
var params = this;
Expand Down Expand Up @@ -404,6 +407,9 @@ var AutoComplete = (function () {
}
});
},
_Close: function () {
this.DOMResults.setAttribute("class", "autocomplete");
},
/**
* Position the results HTML element
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/autocomplete.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface Params {
_Limit: any;
_MinChars: any;
_Open: any;
_Close: any;
_Position: any;
_Post: any;
_Pre: any;
Expand Down Expand Up @@ -224,6 +225,8 @@ class AutoComplete {
this._Open();
}.bind(this)
);
} else {
this._Close();
}
},
Operator: ConditionOperator.AND,
Expand Down Expand Up @@ -326,7 +329,7 @@ class AutoComplete {
*/
_Blur: function(now: boolean = false): void {
if (now) {
this.DOMResults.setAttribute("class", "autocomplete");
this._Close();
} else {
var params = this;
setTimeout(function() {
Expand Down Expand Up @@ -367,6 +370,10 @@ class AutoComplete {
});
},

_Close: function(): void {
this.DOMResults.setAttribute("class", "autocomplete");
},

/**
* Position the results HTML element
*/
Expand Down