effective_bootstrap 0.6.16 → 0.6.17

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: ee127d9cd5bf9286c39d6956f815d55187024a996e90752fc44a022401adc6b6
4
- data.tar.gz: 3e93f1f0f9caa77a5aeca17550597d80e250471c390924aebcb255b074e1e9d1
3
+ metadata.gz: fc535e621de5c8452a1fe9eb6fb5114b2a7b996a6f4d3c4094522403d457ece9
4
+ data.tar.gz: b32da0c613b18f72e8a1aa5ec75244e74570b81901ca791a0550eeb6111a065d
5
5
  SHA512:
6
- metadata.gz: dfcb11403fdacfe1aaf2cb7c4b6b0eb7dfa5963a1ea31c06131cb5e32d1ef93cceab0a83794e357833fe0b9bc18dcb36ea9bdfbcffa17cdccfa150dc0b42fdfe
7
- data.tar.gz: 8953ebb9de05d0bc59e20962752706055ac8a00f86fb8e4f43989fa8a601d878b9d4ab0aaeb38c20f24801d5106453247ac7b7740755eaa55047069303d03cb2
6
+ metadata.gz: bf9e3af2cd5f6c6e45f63dc83e899b3dea25ac577c182c3060975baaf7d885b4c18649e530b96d91714051497301917389975cac5c7d3321fc2eee086d04b0d9
7
+ data.tar.gz: 7728213c5431dc7ae8fc9c51f7271a9d971ea8bb0eadd179bc2ad05e622cc2e04d136f2e65e2f834a2b3a1adf2496abb0ebf720be36e15b3d2ca2b328fa7b666
@@ -0,0 +1,16 @@
1
+ let initTabs = function() {
2
+ let $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane');
3
+
4
+ if ($tab_with_error.length > 0) {
5
+ $(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
6
+ } else if (document.location.hash.length > 0) {
7
+ let $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");
8
+
9
+ if ($tab_from_url.length > 0) {
10
+ document.location.hash = ""; // This prevents scrolling to the wrong place in the page
11
+ $tab_from_url.tab("show");
12
+ }
13
+ }
14
+ }
15
+
16
+ $(document).ready(initTabs);
@@ -13,7 +13,7 @@ module EffectiveFormBuilderHelper
13
13
  "new_#{class_name}"
14
14
  end
15
15
 
16
- options[:html] = (options[:html] || {}).merge(novalidate: true, onsubmit: 'return EffectiveForm.validate(this);')
16
+ options[:html] = (options[:html] || {}).merge(novalidate: true, onsubmit: 'return EffectiveForm.validate(this)')
17
17
 
18
18
  remote_index = options.except(:model).hash.abs
19
19
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.6.16'.freeze
2
+ VERSION = '0.6.17'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.16
4
+ version: 0.6.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2020-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -375,7 +375,7 @@ files:
375
375
  - app/assets/javascripts/effective_bootstrap/form.js.coffee
376
376
  - app/assets/javascripts/effective_bootstrap/logic.js.coffee
377
377
  - app/assets/javascripts/effective_bootstrap/other.js.coffee
378
- - app/assets/javascripts/effective_bootstrap/tabs.js.coffee
378
+ - app/assets/javascripts/effective_bootstrap/tabs.js
379
379
  - app/assets/javascripts/effective_checks/initialize.js.coffee
380
380
  - app/assets/javascripts/effective_checks/input.js
381
381
  - app/assets/javascripts/effective_ck_editor/initialize.js.coffee
@@ -1,6 +0,0 @@
1
- showTab = ->
2
- if document.location.hash.length > 0
3
- $('.nav.nav-tabs').find("a[href='#{document.location.hash}']").tab('show')
4
-
5
- $ -> showTab()
6
- $(document).on 'turbolinks:load', -> showTab()