twitter_bootstrap_combo 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: ed89c13be0129a83c6fc96241c5bfabf6e8771f3
4
- data.tar.gz: ce015ce6495d2d2b53f8abe8102244e7e3550e0b
3
+ metadata.gz: 565d31a0e27657ae1b0c12f0f7267ebe43fc1b06
4
+ data.tar.gz: e659f9d58de61b31e3de330dbe6f7ca0d0eec7a4
5
5
  SHA512:
6
- metadata.gz: 38eddcd8236494c0c72868a459466678820ccf60052b84a818d1ac9332ee5c82c0da3691d3169c61803ea2ea2b19aa220f370120a7a4bfcd0c070b0896fe02b0
7
- data.tar.gz: d153345d2c0b613a4f04a4816765f19daa0f7ce5c16b9349ff2eb42065640f2b69f75a67ce41919c5ad6f43d68623bee93c801e66838bb97744beeff86f9ac45
6
+ metadata.gz: 74697dc2f50c0678901990d6b42796c09468ad8de3cdbcdaf4943e315b6765f7cf0345421b7ecf687689ec9fffbac4880d028f8f65505e00be93f3d0e615879e
7
+ data.tar.gz: bbe37ce0afc7d5a1ee55d6d3e3f7fe5ff4fd7f4b9fe2bad6b4836dad0fb61b4b499e0187d4bbf4943614744e8008870967505e71ae8a3c00786ebf2a055b8c93
@@ -1,3 +1,3 @@
1
1
  module TwitterBootstrapCombo
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -7,15 +7,17 @@ module TwitterBootstrapCombo
7
7
 
8
8
  container.map do |element|
9
9
  if Array === element then
10
- text, value = element
10
+ text, value, options = element
11
11
  else
12
12
  text, value = element, element
13
13
  end
14
- css_class = []
14
+ options ||= {}
15
+ options[:class] ||= ''
15
16
  if selected == value then
16
- css_class << "active"
17
+ options[:class] += ' active'
17
18
  end
18
- content_tag(:li, :class => css_class.join(" ")) do
19
+ options.reject! { |k,v| v.empty? }
20
+ content_tag(:li, options) do
19
21
  link_to(text, '#', :class => "combo_box_item", :data => { :value => value })
20
22
  end
21
23
  end.join().html_safe
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_bootstrap_combo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain Tartiere