effective_bootstrap 0.9.37 → 0.9.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_bootstrap_helper.rb +16 -5
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b22f36af611b8928951e32da7674994739220cf189d8b1486359e58507a66bff
|
4
|
+
data.tar.gz: 884b64100e7d832a0ba995f6b0e14b1ac12e147e560b0a583cb40ea52dd57f69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-#{
|
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-#{
|
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-#{
|
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 =
|
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 =
|
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
|