effective_bootstrap 0.10.4 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce183f7b5ec8710057b26c596d126df576635f2f056c2b5f691c817aa043d49d
4
- data.tar.gz: 2e4697f95f477939c744e6fd7e7e44426f15975b192fae10c7061baaab384096
3
+ metadata.gz: aecd7f34090dadf9e4a0b435026077f84ba05ca2c9411ec1b9d63ab86162bc90
4
+ data.tar.gz: b320780d29265b6521b1b10b78a57ed47e4f194a4fd2ee3050c6ff96dc9b2a71
5
5
  SHA512:
6
- metadata.gz: bf040655168c88bfe628a87182d061147ecc7b82554e268fa9b1ac75cbbf2cdb911326642c730a568d60438762cb71da7fcdc57f2f46622bf40f99d8051d9392
7
- data.tar.gz: 01ab704d07b028abc72d72311e6ac090bc68de56993c1be93d8b74945d8cccb560275d50ba71fcdfb798834cb99f07ee615f378c262236a284791bdf6f98fc78
6
+ metadata.gz: 02a861afeb18e07e50ac3e6f9033302517313257dd3420a08b22acedb6b7c6b8b8912ef6999c2b448a558e0efe6c5ee1c248db97adde88ea585398429a91d57a
7
+ data.tar.gz: 59ee4eefd5b06b4beb0151b9ddb1d75054e66457d6474037fc3479c369de95fcc19c3f8f8939305988cd9646f23635173878376bb19ecb29240377b276aed290
@@ -1,7 +1,15 @@
1
1
  # Fade out cocoon remove.
2
2
  $(document).on 'cocoon:before-remove', (event, $obj) ->
3
- $(event.target).data('remove-timeout', 1000)
4
- $obj.fadeOut('slow')
3
+ $button = $(event.currentTarget.activeElement)
4
+
5
+ confirm = ($button.data('confirm') || '').length > 0
6
+ confirmed = $button.data('confirmed') || false
7
+
8
+ if confirm && !confirmed
9
+ event.preventDefault()
10
+ else
11
+ $(event.target).data('remove-timeout', 1000)
12
+ $obj.fadeOut('slow')
5
13
 
6
14
  # Open all external trix links in a new window.
7
15
  $(document).on 'click', '.trix-content a', (event) ->
@@ -3,13 +3,13 @@ $(document).ready(function() {
3
3
 
4
4
  if ($tab_with_error.length > 0) {
5
5
  $(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
6
- } else if (document.location.hash.length > 0) {
7
- var $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");
6
+ return true;
8
7
 
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
- }
8
+ } else if (document.location.search.length > 0) {
9
+ var tab = new URLSearchParams(document.location.search).get('tab');
10
+ if(tab.length == 0) { return false; }
11
+
12
+ $('.nav.nav-tabs').find("a[href^='#" + tab + "']").tab('show');
13
13
  }
14
14
  });
15
15
 
@@ -105,7 +105,7 @@ module EffectiveBootstrapHelper
105
105
  def collapse(label, opts = {}, &block)
106
106
  raise 'expected a block' unless block_given?
107
107
 
108
- return accordian_collapse(label, opts, &block) if @_accordion_active
108
+ return accordion_collapse(label, opts, &block) if @_accordion_active
109
109
 
110
110
  id = "collapse-#{effective_bootstrap_unique_id}"
111
111
  show = (opts.delete(:show) == true)
@@ -492,7 +492,7 @@ module EffectiveBootstrapHelper
492
492
  raise 'expected a block' unless block_given?
493
493
 
494
494
  @_tab_mode = :tablist
495
- @_tab_active = (active || :first)
495
+ @_tab_active = :first if active.nil?
496
496
  @_tab_unique = effective_bootstrap_unique_id if unique
497
497
 
498
498
  content_tag(:ul, {class: 'nav nav-tabs', role: 'tablist'}.merge(list)) do
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.10.4'.freeze
2
+ VERSION = '0.10.7'.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.10.4
4
+ version: 0.10.7
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: 2022-01-21 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails