simple_drilldown 0.14.1 → 0.14.3

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
  SHA256:
3
- metadata.gz: ef72a1d7f488dd64e45e610dafbef583ed0be5c3e65ae1a4fe024350efc5bde9
4
- data.tar.gz: 356bbee827c123946e2ec7d75891b81454f862ed57d1ba88bddc210b47e94884
3
+ metadata.gz: 84022afd7bb8dd36bfca2b285ddf9451f794848c41119745506f5cef2d700796
4
+ data.tar.gz: 79bd64686fecaf97e94ae35bbae64a19ee08a229d9643e7d22d6932d0988dc20
5
5
  SHA512:
6
- metadata.gz: f3a2390ecacca9bd85ce30e768aa662917f4b165df4f77e45cccfbb3201cb43548bc4cfd21052d0e835f1ed58a1770dd3d92f66283792aed86f5001e3171676b
7
- data.tar.gz: ee791c11f609c1ca18dd95405c80be69c73e7a8ba79ba4cb4b4dd32164f49f93224f2a22ec8e452aeb71ccf60c709e66ae00a7f4433c587ab25d97c2b08979b0
6
+ metadata.gz: 28350243c7fcbf93d18648a7b212b89d3762edff818068d2f6e6ee876841dfd1df8ce4e74910f42e2762c2c0336d661e96fbed5458ce739ac342468fb727f490
7
+ data.tar.gz: 113ca437b9d800ef894e0a8ff6cdfecec7cdc70e21fd83721b1a527fae35b703a3564fd4d975adde78806b446bd92c34388d87a79ac388d100b0f0f4f6f060e4
@@ -87,14 +87,23 @@
87
87
  firstPoint = chart.getElementsAtEventForMode(e, 'nearest', { intersect: true }, false)[0]
88
88
  if (firstPoint) {
89
89
  label = chart.data.labels[firstPoint.index];
90
- value = chart.data.datasets[firstPoint.datasetIndex].data[firstPoint._index];
91
- console.log("Label: " + label + ", Value: " + value);
92
- new_location = window.location.toString();
93
- new_location = new_location.replace(/#.*$/, '');
94
- new_location = new_location.replace("&search[dimensions][]=<%= @dimensions[0][:url_param_name] %>", '');
95
- new_location = new_location + '&search[filter][<%= @dimensions[0][:url_param_name] %>][]=' + label;
96
- console.log(new_location);
97
- window.location = new_location;
90
+ console.log("Label: " + label);
91
+ new_location = new URL(window.location.toString());
92
+ new_location.hash = '';
93
+ params = new_location.searchParams;
94
+ dimensions = params.getAll('search[dimensions][]');
95
+ if (dimensions) {
96
+ delete(dimensions[dimensions.indexOf('<%= @dimensions[0][:url_param_name] %>')]);
97
+ if (dimensions.length > 0) {
98
+ params.set('search[dimensions][]', dimensions);
99
+ } else {
100
+ params.delete('search[dimensions][]');
101
+ }
102
+ }
103
+ params.delete('search[filter][<%= @dimensions[0][:url_param_name] %>][]');
104
+ params.set('search[filter][<%= @dimensions[0][:url_param_name] %>][]', label);
105
+ new_location.searchParams = params;
106
+ window.location = new_location.href;
98
107
  }
99
108
  });
100
109
  <% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleDrilldown
4
- VERSION = '0.14.1'
4
+ VERSION = '0.14.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_drilldown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-28 00:00:00.000000000 Z
11
+ date: 2022-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caxlsx_rails