Skip to content

Commit

Permalink
Merge pull request #31 from User756675678/patch-1
Browse files Browse the repository at this point in the history
Remove ES6 features
  • Loading branch information
Johan Halse authored Apr 21, 2020
2 parents b65e6af + 2f74495 commit d009873
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/tiny-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ var factory = function($, window) {
);

this.el.on("blur", ".autocomplete-field", $.proxy(this.closeList, this));

var self = this;
// Update maxItems when window size change
$(window).resize(
this.debounce(() => {
this.debounce(function() {
if (
window.innerWidth < this.settings.mobileWidth &&
this.settings.maxItemsOnMobile !== null
window.innerWidth < self.settings.mobileWidth &&
self.settings.maxItemsOnMobile !== null
) {
this.settings.maxItems = Math.min(
this.settings.maxItems,
this.settings.maxItemsOnMobile
self.settings.maxItems = Math.min(
self.settings.maxItems,
self.settings.maxItemsOnMobile
);
} else {
this.settings.maxItems = this.settings.maxItemsOnLarge;
self.settings.maxItems = self.settings.maxItemsOnLarge;
}
}, 250)
);
Expand Down

0 comments on commit d009873

Please sign in to comment.