bullet_train 1.7.10 → 1.7.11

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: 218265892a79f3d9eeedf83b0b06612d8c85d87d08c0f5c6e9e1cf0bb5af5ed9
4
- data.tar.gz: a44a684a235ec09762a865492b10f46aa7c531318464776d484b7bb632345670
3
+ metadata.gz: 9b669208e7d12f0f0959de7acac0d57e759914215a3b351e43235bfd73817586
4
+ data.tar.gz: 2221f7a2e7339b6cb96c2e239162727b1b8617f3494d79cee74562ce21e1de48
5
5
  SHA512:
6
- metadata.gz: a4ed19153316987cfbc790b90fc9f1315036effc6f2ea616e8a5ed62bdf4295f9d07013f3528d04835ec30018edf912fcf24caad3188a0e83587f087c01ba2a4
7
- data.tar.gz: 487b16de9dd83d1cf3b8d45c6c2386ec81b356652133e1560254f9186d5df4929bb570887d5391b227a6f631f5e9dc0321f5c58520a74144d1d838c42a2f9bd0
6
+ metadata.gz: 93e30a82f7d95192cff235f7cf9eba694c94b3bcd2a3e62cd15ed19aa046896d9ac4b1762ee99d6596dbea7bed04d6a329cc5df7ec87759c15ea03e3f38ba602
7
+ data.tar.gz: 60855c12ff94f6b01a64140627de0c7b220737d5d9a63c4d810e687b910ef5d1249bf4ad34f770a1471d724b3896f8e2f99915d012682d9875665b29ec758a52
@@ -48,7 +48,7 @@
48
48
  <% end %>
49
49
 
50
50
  <script type="text/javascript">
51
- $(document).on('turbo:load', function() {
51
+ document.addEventListener('turbo:load', function() {
52
52
 
53
53
  // generate a mapping of js timezones compared to rails timezones.
54
54
  var jsTimezoneMapping = {
@@ -60,17 +60,16 @@
60
60
  // figure out the rails timezone value.
61
61
  var railsValue = jsTimezoneMapping[jstz.determine().name()];
62
62
 
63
- var useBrowserTimeZone = $("#user_time_zone")[0].dataset.useBrowserTimeZone
63
+ var useBrowserTimeZone = document.querySelector("#user_time_zone").dataset.useBrowserTimeZone
64
64
 
65
65
  if (useBrowserTimeZone == "true") {
66
- // set the form accordingly.
67
- var $option = $("#user_time_zone option[value=\"" + railsValue + "\"]")
68
- $option.prop('selected', true);
69
-
70
- // update the select2 as well. is there a better way to handle this?
71
- // why don't _they_ handle this for us?
72
- $("#select2-user_time_zone-container").attr('title', $option.text());
73
- $("#select2-user_time_zone-container").text($option.text());
66
+ // set the form accordingly if we can find a matching option in the dropdown
67
+ var option = document.querySelector("#user_time_zone option[value=\"" + railsValue + "\"]")
68
+ if(option){
69
+ document.querySelector("#user_time_zone").value = railsValue;
70
+ }else{
71
+ console.log('We were unable to find a timezone matching the rails detected value of ', railsValue);
72
+ }
74
73
  }
75
74
 
76
75
  });
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.7.10"
2
+ VERSION = "1.7.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.10
4
+ version: 1.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-30 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard