grid_table 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb5341d0c50f6878b55cce0a85e5f2cde174f184
4
- data.tar.gz: b500976a3684460ecb3f12d1e345b797d6077a6e
3
+ metadata.gz: e49713f15732a6342839fbb76a455fc844e9e8b0
4
+ data.tar.gz: fb0ccace4cecad020a666978a828a952408b2944
5
5
  SHA512:
6
- metadata.gz: 8e3c408bafe26b976eab971dcce36e7964a70668ebae8feb529de9f77c2dfc018fff96a98c3e14ea5d5af4c561fd27301f02f2bd87757773074428932dc2b23f
7
- data.tar.gz: 1115b8b02d21a6d3bff6fcbbe0fdbac16b2283141cc101ce5acd65d131fb1f91b8e1ad7f2ad8011c2e700299310e4dd7a4b8ba720e2c0b97b2bd664399f18278
6
+ metadata.gz: 843e4b5ab3055808b4106844e433215ff924c3fcf4ea9422306cf773625913955a26e58d99704c3a7a3aaf4cfc7b46f9b32b973e5d618cd581b412518ebc039f
7
+ data.tar.gz: 984165e174c880a8f70d78ede133933d0cc88e9f935886d0860e927b73ed2fda67396f5e2496d6af7567f08be32fad041cad77d14eee46cb3648f82e61331a27
@@ -1,3 +1,3 @@
1
1
  module GridTable
2
- VERSION = '1.6.3'.freeze
2
+ VERSION = '1.6.4'.freeze
3
3
  end
@@ -123,10 +123,12 @@ GridTable = (function() {
123
123
  });
124
124
  };
125
125
  })(this));
126
+
126
127
  var dataFilterSelector = "[data-filter]";
128
+
127
129
  $("select" + dataFilterSelector).each((function (_this) {
128
130
  return function (index, filter) {
129
- if ($(filter).data('grid-table-id').split(',').includes(_this.gridTableParams.getId())) {
131
+ if (_this.gridTableParams.includeFilter(filter)) {
130
132
  _this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
131
133
  return $(filter).on("change", function (event) {
132
134
  _this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
@@ -139,7 +141,7 @@ GridTable = (function() {
139
141
  // find non-selectable inputs
140
142
  $("input:not([type=radio], [type=checkbox])" + dataFilterSelector).each((function (_this) {
141
143
  return function (index, filter) {
142
- if ($(filter).data('grid-table-id').split(',').includes(_this.gridTableParams.getId())) {
144
+ if (_this.gridTableParams.includeFilter(filter)) {
143
145
  var timeout;
144
146
  timeout = null;
145
147
  return $(filter).on("propertychange keyup input paste", function (event) {
@@ -155,19 +157,21 @@ GridTable = (function() {
155
157
 
156
158
  $("input:radio" + dataFilterSelector + ",input:checkbox" + dataFilterSelector).each((function (_this) {
157
159
  return function(index, filter) {
158
- var timeout;
159
- // only setFilter for radio && checkbox inputs if they are also checked
160
- if (filter.checked) {
161
- _this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
162
- }
163
- timeout = null;
164
- return $(filter).on("change", function(event) {
165
- clearTimeout(timeout);
166
- return timeout = setTimeout((function() {
160
+ if (_this.gridTableParams.includeFilter(filter)) {
161
+ var timeout;
162
+ // only setFilter for radio && checkbox inputs if they are also checked
163
+ if (filter.checked) {
167
164
  _this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
168
- return _this.loadData();
169
- }), 500);
170
- });
165
+ }
166
+ timeout = null;
167
+ return $(filter).on("change", function(event) {
168
+ clearTimeout(timeout);
169
+ return timeout = setTimeout((function() {
170
+ _this.gridTableParams.setFilter($(filter).data('field'), $(filter).val());
171
+ return _this.loadData();
172
+ }), 500);
173
+ });
174
+ }
171
175
  };
172
176
  })(this));
173
177
 
@@ -554,6 +558,12 @@ GridTable = (function() {
554
558
  }
555
559
  };
556
560
 
561
+ GridTableParams.prototype.includeFilter = function (filter) {
562
+ var gridTableIds = $(filter).data('grid-table-id');
563
+
564
+ return $.inArray(this.id, gridTableIds.split(','));
565
+ }
566
+
557
567
  GridTableParams.prototype.buildUrl = function(baseUrl, skip_paging) {
558
568
  var k, url, v, _ref;
559
569
  if (skip_paging == null) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid_table
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Principe
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-17 00:00:00.000000000 Z
12
+ date: 2017-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler