bootstrap_concerns 0.5.6 → 0.6.0

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: 2c462b0648718081a4f8a1bd1669b1c3e3f9707ff2b5320f71fcefaabc7481cb
4
- data.tar.gz: 3b51a9f3f0612d7fd98507ccc5b3718bfbff2cf404d32939a926a0f009da9c23
3
+ metadata.gz: cbdccc03f2b09a57b38af5f47d1f60288ddc0af04163573b0094814a600217a3
4
+ data.tar.gz: 0d313a2a4e341cfa4e09a48bc71b2db63e305cdb7aa689b5928435330e2a0702
5
5
  SHA512:
6
- metadata.gz: 72ae80b00c79d9bd8429cb4bec74545d877a1c414e8482dc9d3e4146d0aa40cb3e78b5871712506e222a0885e4470f374bfc8efbdff955c17394a952759aa548
7
- data.tar.gz: 7172244a7b5e848aa726e9bc2c8407ee86dc20c7a3a2a2a7f02bd52af80ca9752298ac0430c0184d64d745024616e92bd7122ba8586bdcfa880116b6c2c27301
6
+ metadata.gz: 3957e30ad08155d5f34981d916605351526c2c10c2acbf304d92a9bcf377712dd9ca13007599bd1174c56ce9612f3aca5cfc6d0affac703131307b409e406ee5
7
+ data.tar.gz: 7746542bf8d745d66c47ef3c56979c748a2fc8b75981a478a1e04d52e7988cd3be5c23072ba924502209831d56a642535d2017b6ef6ea00496a2f750b7a73b5e
@@ -14,6 +14,14 @@ module BootstrapConcerns
14
14
  icon("check-circle-fill")
15
15
  end
16
16
 
17
+ # A link to a section of the current page. A bare fragment resolves against the address bar, so the
18
+ # query string survives the click, and the link opts out of Turbo Drive, which would fetch the
19
+ # document again where the browser simply scrolls. Everything else is bs_link_to's: a button unless
20
+ # told `button: false`.
21
+ def bs_anchor_to(name, anchor, **html_options)
22
+ bs_link_to(name, "##{anchor}", html_options.deep_merge(data: {turbo: false}))
23
+ end
24
+
17
25
  def bs_button_tag(content_or_options = nil, options = nil, &)
18
26
  normalized_options =
19
27
  if content_or_options.is_a?(Hash)
@@ -68,7 +76,8 @@ module BootstrapConcerns
68
76
  html_options ||= {}
69
77
  end
70
78
 
71
- normalized_html_options.merge!(Option.options_with_button_class(normalized_html_options))
79
+ button = normalized_html_options.delete(:button) { true }
80
+ normalized_html_options.merge!(Option.options_with_button_class(normalized_html_options)) if button
72
81
 
73
82
  public_send(
74
83
  method_name,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_concerns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Brooks
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 4.0.3
96
+ rubygems_version: 4.0.20
97
97
  specification_version: 4
98
98
  summary: Concerns for building Bootstrap components with Ruby on Rails.
99
99
  test_files: []