rails_nav 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rails_nav.rb +9 -9
- data/rails_nav.gemspec +1 -1
- metadata +1 -1
data/lib/rails_nav.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
module Nav
|
9
9
|
def Nav.version()
|
10
|
-
'0.0.
|
10
|
+
'0.0.4'
|
11
11
|
end
|
12
12
|
|
13
13
|
class Item
|
@@ -86,12 +86,12 @@
|
|
86
86
|
end
|
87
87
|
alias_method(:to_s, :to_html)
|
88
88
|
|
89
|
-
def List.
|
90
|
-
@
|
89
|
+
def List.strategy(*value)
|
90
|
+
@strategy ||= (value.first || :dl).to_s
|
91
91
|
end
|
92
92
|
|
93
|
-
def List.
|
94
|
-
@
|
93
|
+
def List.strategy=(value)
|
94
|
+
@strategy = value.first.to_s
|
95
95
|
end
|
96
96
|
|
97
97
|
def List.to_html(*args, &block)
|
@@ -120,11 +120,11 @@
|
|
120
120
|
|
121
121
|
options.update(list.options)
|
122
122
|
|
123
|
-
list_ = List.
|
124
|
-
item_ = List.
|
123
|
+
list_ = List.strategy =~ /dl/ ? :dl_ : :ul_
|
124
|
+
item_ = List.strategy =~ /dl/ ? :dd_ : :li_
|
125
125
|
|
126
126
|
nav_(options){
|
127
|
-
unless List.
|
127
|
+
unless List.strategy =~ /dl/
|
128
128
|
label_{ list.label } unless list.label.blank?
|
129
129
|
end
|
130
130
|
|
@@ -132,7 +132,7 @@
|
|
132
132
|
first_index = 0
|
133
133
|
last_index = list.size - 1
|
134
134
|
|
135
|
-
if List.
|
135
|
+
if List.strategy =~ /dl/
|
136
136
|
dt_{ list.label } unless list.label.blank?
|
137
137
|
end
|
138
138
|
|
data/rails_nav.gemspec
CHANGED