effective_bootstrap 0.9.37 → 0.9.38

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: b1772102ddc52f73871d564739ecf3ed9edd05d7213764f9820ffcaddddd5341
4
- data.tar.gz: 4767059a01a6d4b34eb6a325f5ab14c941e1de8cef6f01f8542fd9dda7956a2a
3
+ metadata.gz: b22f36af611b8928951e32da7674994739220cf189d8b1486359e58507a66bff
4
+ data.tar.gz: 884b64100e7d832a0ba995f6b0e14b1ac12e147e560b0a583cb40ea52dd57f69
5
5
  SHA512:
6
- metadata.gz: 26050084b30228053d8cd328e30d1f48668ed640a951074060d21db38d102560fc7fa4ae15f7b5bf16459fc65f0cccc552fd749546b9bf5054b2b30353249502
7
- data.tar.gz: 5e3c97e66bd4bf2f6288f302a94adb085a6723fdebd6a1ead7661e8602249048814d1fcaa54d6a60f9f94bc24eee287494de9fbc5e424eaedddf0add94b58504
6
+ metadata.gz: 4ffe5bbd7785815688f74a8e0c3304438dff1d12f3213c20220e664f40c0d4f71fc37e06f09de4beb15994cc63ff2dd766c79a666b58353ce52b4919f57f7c2e
7
+ data.tar.gz: 28330b3adfa44c418270d85ace2339960d2664eb5d44fa56158a0ff23aea940648567a3422b7a6f81d5466a13bcab6a2549580bfc1ad53dd24135b4e9633a963
@@ -10,7 +10,7 @@ module EffectiveBootstrapHelper
10
10
  def accordion(options = nil, &block)
11
11
  (options ||= {})[:class] = "accordion #{options.delete(:class)}".strip
12
12
 
13
- id = "accordion-#{String.new.object_id}"
13
+ id = "accordion-#{effective_bootstrap_unique_id}"
14
14
 
15
15
  @_accordion_active = id
16
16
  content = content_tag(:div, capture(&block), options.merge(id: id))
@@ -62,7 +62,7 @@ module EffectiveBootstrapHelper
62
62
  def collapse(label, opts = {}, &block)
63
63
  raise 'expected a block' unless block_given?
64
64
 
65
- id = "collapse-#{String.new.object_id}"
65
+ id = "collapse-#{effective_bootstrap_unique_id}"
66
66
  show = (opts.delete(:show) == true)
67
67
 
68
68
  link_opts = { 'data-toggle': 'collapse', role: 'button', href: "##{id}", 'aria-controls': "##{id}", 'aria-expanded': show }
@@ -259,7 +259,7 @@ module EffectiveBootstrapHelper
259
259
  def nav_dropdown(label, right: false, link_class: [], list_class: [], &block)
260
260
  raise 'expected a block' unless block_given?
261
261
 
262
- id = "dropdown-#{String.new.object_id}"
262
+ id = "dropdown-#{effective_bootstrap_unique_id}"
263
263
 
264
264
  content_tag(:li, class: 'nav-item dropdown') do
265
265
  content_tag(:a, class: 'nav-link dropdown-toggle', href: '#', id: id, role: 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) do
@@ -436,7 +436,7 @@ module EffectiveBootstrapHelper
436
436
 
437
437
  @_tab_mode = :tablist
438
438
  @_tab_active = (active || :first)
439
- @_tab_unique = String.new.object_id if unique
439
+ @_tab_unique = effective_bootstrap_unique_id if unique
440
440
 
441
441
  content_tag(:ul, {class: 'nav nav-tabs', role: 'tablist'}.merge(list)) do
442
442
  yield # Yield to tab the first time
@@ -476,7 +476,7 @@ module EffectiveBootstrapHelper
476
476
 
477
477
  @_tab_mode = :tablist_vertical
478
478
  @_tab_active = (active || :first)
479
- @_tab_unique = String.new.object_id if unique
479
+ @_tab_unique = effective_bootstrap_unique_id if unique
480
480
 
481
481
  content_tag(:div, class: 'row border') do
482
482
  content_tag(:div, class: 'col-3 border-right') do
@@ -504,4 +504,15 @@ module EffectiveBootstrapHelper
504
504
  end
505
505
  end
506
506
 
507
+ def effective_bootstrap_unique_id
508
+ # Set the first unique value
509
+ @_effective_bootstrap_unique_id ||= Time.zone.now.to_i
510
+
511
+ # Everytime we access this function make a new one
512
+ @_effective_bootstrap_unique_id = @_effective_bootstrap_unique_id + 1
513
+
514
+ # Return the updated value
515
+ @_effective_bootstrap_unique_id
516
+ end
517
+
507
518
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.37'.freeze
2
+ VERSION = '0.9.38'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.37
4
+ version: 0.9.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect