rails-bootstrap-tabs 0.2.4 → 0.2.5

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
- SHA1:
3
- metadata.gz: bbfbb9984d3664b81fac5ecece7d5cf5dddbae0d
4
- data.tar.gz: 85e4087ad3bc28c067ad3c55293239099c7076e1
2
+ SHA256:
3
+ metadata.gz: 0c51419b342fc09fc1fbdbf5fe3eeafff572dda98651851d699cd9a6f5c9ae30
4
+ data.tar.gz: 0b1b7d81087af4f222e417f985acd3ad94ce6bec2b0d7f58df95bb880f15ca7e
5
5
  SHA512:
6
- metadata.gz: 02d055262060e0e158bbdd326d2d1e9d59b5d7e62806727471d91a1478603fec8a8593ffa2005c408e302ff0dd6ca5f96f09cbc25be6721c452ffdff4998af62
7
- data.tar.gz: 663814a10dc371c32cd3ec6cf4c488eedfccbf10767ee327afcc026f62a519d23d33bdfcdb86dd99018538fb0eaa32f93a576c3d4664690d75eb68baf267e8f0
6
+ metadata.gz: '0555693dc97f1a3a98d80861f37ef837a62a1372adbc7bbc08dea44b8f6ea1757e30aea3488cf58bb8611759a75581d52e43a98db4dcfe35081ae542f210b4ab'
7
+ data.tar.gz: 6e7113b6ef0fccef9fca7c7d9d04ffa12b66b40c9086932e1c6df90df8e6cc6fe95655701265d9f16a7b347a6039c72f088c8d11bb9cf40e4ed61b98d4d85f2d
@@ -3,6 +3,7 @@ require 'rails-bootstrap-tabs/helpers/tabs_helper'
3
3
  module RailsBootstrapTabs
4
4
  mattr_accessor :bootstrap_version do; 3; end
5
5
  mattr_accessor :fade_effect do; false; end
6
+ mattr_accessor :nav_markup do; false; end
6
7
 
7
8
  module Rails
8
9
  class Engine < ::Rails::Engine
@@ -1,8 +1,14 @@
1
1
  module RailsBootstrapTabs::Renderers
2
2
  class TabsBootstrap4Renderer < TabsRenderer
3
3
  def render_tabs_wrapper
4
- content_tag :ul, class: 'nav nav-tabs' do
5
- yield
4
+ if @options[:nav_markup]
5
+ content_tag :nav, class: 'nav nav-tabs' do
6
+ yield
7
+ end
8
+ else
9
+ content_tag :ul, class: 'nav nav-tabs' do
10
+ yield
11
+ end
6
12
  end
7
13
  end
8
14
 
@@ -11,10 +17,16 @@ module RailsBootstrapTabs::Renderers
11
17
  link_class = 'nav-link'
12
18
  link_class << ' active' if options[:active]
13
19
  link_class << " #{options[:link_class]}" if options[:link_class]
14
- content_tag :li, class: 'nav-item' do
20
+ if options[:nav_markup]
15
21
  link_to "##{options[:anchor]}", data: { toggle: 'tab' }, class: link_class do
16
22
  yield
17
23
  end
24
+ else
25
+ content_tag :li, class: 'nav-item' do
26
+ link_to "##{options[:anchor]}", data: { toggle: 'tab' }, class: link_class do
27
+ yield
28
+ end
29
+ end
18
30
  end
19
31
  end
20
32
 
@@ -22,7 +22,20 @@ module RailsBootstrapTabs::Renderers
22
22
  def prepare_tabs
23
23
  @tabs.each.with_index do |tab, index|
24
24
  tab.options[:anchor] ||= "tab-#{index}-#{rstr(index)}"
25
- tab.options[:fade_effect] ||= RailsBootstrapTabs.fade_effect || @options[:fade_effect]
25
+ if tab.options[:fade_effect].nil?
26
+ if @options.key?(:fade_effect)
27
+ tab.options[:fade_effect] = @options[:fade_effect]
28
+ else
29
+ tab.options[:fade_effect] = RailsBootstrapTabs.fade_effect
30
+ end
31
+ end
32
+ if tab.options[:nav_markup].nil?
33
+ if @options.key?(:nav_markup)
34
+ tab.options[:nav_markup] = @options[:nav_markup]
35
+ else
36
+ tab.options[:nav_markup] = RailsBootstrapTabs.nav_markup
37
+ end
38
+ end
26
39
  end
27
40
  active_tab = @tabs.find { |t| t.options[:active] }
28
41
  active_tab ||= @tabs.first
@@ -1,3 +1,3 @@
1
1
  module RailsBootstrapTabs
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-bootstrap-tabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Reshetnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-14 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  requirements: []
80
80
  rubyforge_project:
81
- rubygems_version: 2.5.1
81
+ rubygems_version: 2.7.7
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: A Rails plugin to build bootstrap tabs