@finqu/cool 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Cool UI v1.2.6 (https://finqu.fi)
2
+ * Cool UI v1.2.7 (https://finqu.fi)
3
3
  * Copyright 2011-2020 Finqu Oy
4
4
  * Licensed under the ISC license - (http://opensource.org/licenses/ISC)
5
5
  */
@@ -2235,6 +2235,7 @@ function (_AbstractUIComponent) {
2235
2235
  _this3.data[_this3.name] = [];
2236
2236
  _this3.searchData = [];
2237
2237
  _this3.searchApi = _this3.$el.data('searchApi') ? _this3.$el.data('searchApi') : _this3.opts.searchApi;
2238
+ _this3.searchRequest = null;
2238
2239
  _this3.type = _this3.$el.data('type') ? _this3.$el.data('type') : _this3.opts.type;
2239
2240
  _this3.contentOpen = false;
2240
2241
  _this3.searchPlaceholder = _this3.$el.data('search-placeholder') ? _this3.$el.data('search-placeholder') : _this3.opts.searchPlaceholder;
@@ -2723,10 +2724,16 @@ function (_AbstractUIComponent) {
2723
2724
  if (this.searchString.length) {
2724
2725
  if (this.searchApi.length) {
2725
2726
  this.$scrollableContent.find('input:not(:checked)').parents('.select-item').not('.static-item').remove();
2726
- $.ajax({
2727
+
2728
+ if (this.searchRequest !== null) {
2729
+ this.searchRequest.abort();
2730
+ }
2731
+
2732
+ this.searchRequest = $.ajax({
2727
2733
  method: 'GET',
2728
2734
  url: this.searchApi + this.searchString
2729
2735
  }).done(function (data) {
2736
+ self.searchRequest = null;
2730
2737
  var items = data.map(function (item) {
2731
2738
  item.id = item[self.primaryKeyword].toString();
2732
2739
  return item;