effective_bootstrap 1.19.10 → 1.19.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 350deb6ca3622c6d0f69405844217f74a82ad8fd84d70285273a084824eb6848
4
- data.tar.gz: 48da7e3b7197c2962fb6c4ab148fdffea4412627a5977d791fca4a91b6e7d741
3
+ metadata.gz: eb2ce2ed34534af72ee963d2644a248240343288e595086550c8c06f47aaf49e
4
+ data.tar.gz: b8451074cec9f9476264e5ce3b79e43496e9f4d97907c2625624269dff586183
5
5
  SHA512:
6
- metadata.gz: 3004f447836ece871770ce69e00ed83ca219de59119edad1f6161f6fa647deb4dd19768695df3c911b6426527df48dc0cd0c5b45ba5ff3ffb6b9e175051f2324
7
- data.tar.gz: ca607c3b9c98f202c60c24f179a572bc3d0cf51b86ee0da8842e7c74f568f9dbb9873a52aed9564eb35cc375951f6db4b0cce1beabb343681c6410ab944c1fa0
6
+ metadata.gz: 275f9dff6497f73c7f2e91fbb670a30c65fcd103ee8f1cc8336cf256c46e17b91f2500509da54cd2ee29d3bd1547b0d8912d3e98b59870be784566463122950a
7
+ data.tar.gz: d43bd8d8dcd98542ea39d43337fd1dda9fd6b336f7c2bb63810c3ae50ccdc118ce2081d8797c873588d92182f29042aa83f1631a49ec898fb772ca683b49f2c8
@@ -5,6 +5,8 @@
5
5
  position: relative;
6
6
  }
7
7
 
8
+ .effective-form-flash { z-index: 1; }
9
+
8
10
  form[data-remote="true"]:not(.show-flash-success) {
9
11
  .effective-form-flash.alert-success { display: none; }
10
12
  }
@@ -340,8 +340,7 @@ module EffectiveBootstrapHelper
340
340
  end
341
341
  end
342
342
 
343
-
344
- def nav_dropdown(label, right: false, groups: false, link_class: [], list_class: [], &block)
343
+ def nav_dropdown(label, right: false, groups: false, sort: false, link_class: [], list_class: [], &block)
345
344
  raise 'expected a block' unless block_given?
346
345
 
347
346
  id = "dropdown-#{effective_bootstrap_unique_id}"
@@ -354,11 +353,16 @@ module EffectiveBootstrapHelper
354
353
 
355
354
  return ''.html_safe if content.blank?
356
355
 
356
+ if sort && !content.include?('dropdown-divider')
357
+ lines = content.gsub("\n", '').split("</a>").reject(&:blank?).map { |line| line + "</a>" }
358
+ content = lines.sort_by { |line| line.match(/<a[^>]*>([^<]*)<\/a>/)[1] || '' }.join("</a>\n")
359
+ end
360
+
357
361
  content_tag(:li, class: 'nav-item dropdown') do
358
362
  content_tag(:a, class: 'nav-link dropdown-toggle', href: '#', id: id, role: 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) do
359
363
  label.html_safe
360
364
  end + content_tag(:div, class: div_class, 'aria-labelledby': id) do
361
- content
365
+ content.html_safe
362
366
  end
363
367
  end
364
368
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '1.19.10'.freeze
2
+ VERSION = '1.19.12'.freeze
3
3
  end
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: 1.19.10
4
+ version: 1.19.12
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: 2025-01-16 00:00:00.000000000 Z
11
+ date: 2025-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails