simple_drilldown 0.14.2 → 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: 2a4c733a59b4e632b71fa7752a8d19f4fc47dde7868cf013e0bdbf896276e98f
4
- data.tar.gz: 3f7350f9f4d88c14a5351158705400110fe57f9e7f1c03bd84c65fd7603b0290
3
+ metadata.gz: 84022afd7bb8dd36bfca2b285ddf9451f794848c41119745506f5cef2d700796
4
+ data.tar.gz: 79bd64686fecaf97e94ae35bbae64a19ee08a229d9643e7d22d6932d0988dc20
5
5
  SHA512:
6
- metadata.gz: 18c58a49d658729ae364559a55cf59e9677e8ff7d20a5ad3d4e8b8ea7cbff7f69b309bfd717e75394e002322eff22f15878ee37ee15677a515feb0f05b95e832
7
- data.tar.gz: 635d388bed35d0b91e83d2676093178d9ed8bb767325ecdbcbb9c519c81bb43bf9bb082797be85bdd424050f5b18918ec79a72c0fd885deb8efc7adc3c48ffc7
6
+ metadata.gz: 28350243c7fcbf93d18648a7b212b89d3762edff818068d2f6e6ee876841dfd1df8ce4e74910f42e2762c2c0336d661e96fbed5458ce739ac342468fb727f490
7
+ data.tar.gz: 113ca437b9d800ef894e0a8ff6cdfecec7cdc70e21fd83721b1a527fae35b703a3564fd4d975adde78806b446bd92c34388d87a79ac388d100b0f0f4f6f060e4
@@ -88,13 +88,22 @@
88
88
  if (firstPoint) {
89
89
  label = chart.data.labels[firstPoint.index];
90
90
  console.log("Label: " + label);
91
- new_location = decodeURI(window.location.toString());
92
- new_location = new_location.replace(/#.*$/, '');
93
- new_location = new_location.replace("&search[dimensions][]=<%= @dimensions[0][:url_param_name] %>", '');
94
- new_location = new_location.replaceAll(/&search\[filter\]\[<%= @dimensions[0][:url_param_name] %>\]\[\]=[^&#]*/g, '');
95
- new_location = new_location + '&search[filter][<%= @dimensions[0][:url_param_name] %>][]=' + label;
96
- console.log(new_location);
97
- window.location = new_location;
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.2'
4
+ VERSION = '0.14.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_drilldown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch