effective_bootstrap 0.9.20 → 0.9.21
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 +26 -1
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d047c5108e24b36af0b9269cea370b61afaae229174b8b3febf59c95fdca14f7
|
4
|
+
data.tar.gz: 75f25ac6d8dc18e6f4b4462a6eb16b237c4aa6898d19c2686348241b8337da0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09531a9a125e7d7aebec11aa7fe41ef563ccc5f1777dc04cb02603ec8edb0d3384ba86d5f3c79aefe5d64b45a72dd4ded0c098fe6593c4347f080c8faaca237f'
|
7
|
+
data.tar.gz: 349e700ff1f0324dd51f81ecb134774720f0de7197d0c1da4684388a67314828c4a211e903a26b279e8adb25b451629632123ac12204a51380738c7f0dac7a67
|
@@ -411,7 +411,9 @@ module EffectiveBootstrapHelper
|
|
411
411
|
|
412
412
|
@_tab_active = nil if @_tab_active == :first
|
413
413
|
|
414
|
-
if @_tab_mode == :
|
414
|
+
if @_tab_mode == :tablist_vertical
|
415
|
+
content_tag(:a, label, id: ('tab-' + controls), class: ['nav-link', ('active' if active)].compact.join(' '), href: '#' + controls, 'aria-controls': controls, 'aria-selected': active.to_s, 'data-toggle': 'tab', role: 'tab')
|
416
|
+
elsif @_tab_mode == :tablist # Inserting the label into the tablist top
|
415
417
|
content_tag(:li, class: 'nav-item') do
|
416
418
|
content_tag(:a, label, id: ('tab-' + controls), class: ['nav-link', ('active' if active)].compact.join(' '), href: '#' + controls, 'aria-controls': controls, 'aria-selected': active.to_s, 'data-toggle': 'tab', role: 'tab')
|
417
419
|
end
|
@@ -423,6 +425,29 @@ module EffectiveBootstrapHelper
|
|
423
425
|
end
|
424
426
|
end
|
425
427
|
|
428
|
+
def vertical_tabs(active: nil, unique: false, list: {}, content: {}, &block)
|
429
|
+
raise 'expected a block' unless block_given?
|
430
|
+
|
431
|
+
@_tab_mode = :tablist_vertical
|
432
|
+
@_tab_active = (active || :first)
|
433
|
+
@_tab_unique = ''.object_id if unique
|
434
|
+
|
435
|
+
content_tag(:div, class: 'row border') do
|
436
|
+
content_tag(:div, class: 'col-3 border-right') do
|
437
|
+
content_tag(:div, {class: 'nav flex-column nav-pills my-2', role: 'tablist', 'aria-orientation': :vertical}.merge(list)) do
|
438
|
+
yield # Yield to tab the first time
|
439
|
+
end
|
440
|
+
end +
|
441
|
+
content_tag(:div, class: 'col-9') do
|
442
|
+
content_tag(:div, {class: 'tab-content my-2'}.merge(content)) do
|
443
|
+
@_tab_mode = :content
|
444
|
+
@_tab_active = (active || :first)
|
445
|
+
yield # Yield to tab the second time
|
446
|
+
end
|
447
|
+
end
|
448
|
+
end
|
449
|
+
end
|
450
|
+
|
426
451
|
def merge_class_key(hash, value)
|
427
452
|
return { :class => value } unless hash.kind_of?(Hash)
|
428
453
|
|
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.9.
|
4
|
+
version: 0.9.21
|
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: 2021-
|
11
|
+
date: 2021-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|