@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.
package/dist/js/cool.js CHANGED
@@ -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
  */
@@ -7,7 +7,7 @@
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
8
8
  typeof define === 'function' && define.amd ? define(['jquery'], factory) :
9
9
  (global = global || self, global.cool = factory());
10
- }(this, function () { 'use strict';
10
+ }(this, (function () { 'use strict';
11
11
 
12
12
  /*!
13
13
  * perfect-scrollbar v1.4.0
@@ -2239,6 +2239,7 @@
2239
2239
  _this3.data[_this3.name] = [];
2240
2240
  _this3.searchData = [];
2241
2241
  _this3.searchApi = _this3.$el.data('searchApi') ? _this3.$el.data('searchApi') : _this3.opts.searchApi;
2242
+ _this3.searchRequest = null;
2242
2243
  _this3.type = _this3.$el.data('type') ? _this3.$el.data('type') : _this3.opts.type;
2243
2244
  _this3.contentOpen = false;
2244
2245
  _this3.searchPlaceholder = _this3.$el.data('search-placeholder') ? _this3.$el.data('search-placeholder') : _this3.opts.searchPlaceholder;
@@ -2727,10 +2728,16 @@
2727
2728
  if (this.searchString.length) {
2728
2729
  if (this.searchApi.length) {
2729
2730
  this.$scrollableContent.find('input:not(:checked)').parents('.select-item').not('.static-item').remove();
2730
- $.ajax({
2731
+
2732
+ if (this.searchRequest !== null) {
2733
+ this.searchRequest.abort();
2734
+ }
2735
+
2736
+ this.searchRequest = $.ajax({
2731
2737
  method: 'GET',
2732
2738
  url: this.searchApi + this.searchString
2733
2739
  }).done(function (data) {
2740
+ self.searchRequest = null;
2734
2741
  var items = data.map(function (item) {
2735
2742
  item.id = item[self.primaryKeyword].toString();
2736
2743
  return item;
@@ -5511,5 +5518,5 @@
5511
5518
 
5512
5519
  return index_umd;
5513
5520
 
5514
- }));
5521
+ })));
5515
5522
  //# sourceMappingURL=cool.js.map