hierarchical_menu 0.1.3 → 0.1.4
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.
- data/Changelog +4 -0
- data/lib/hmenu/constants.rb +1 -1
- data/lib/hmenu/node.rb +8 -2
- metadata +7 -3
data/Changelog
CHANGED
data/lib/hmenu/constants.rb
CHANGED
data/lib/hmenu/node.rb
CHANGED
@@ -16,7 +16,7 @@ module HMenu
|
|
16
16
|
#
|
17
17
|
# +:description+:: String, will be rendered as a +title+ HTML attribute
|
18
18
|
#
|
19
|
-
# +:extra_class+:: String, add extra HTML/CSS class; you may also provide a space-separeted list of classes; NOTE: class +hmenu-selected+ is special: the JavaScript code from HMenu::JS.out (function +reset_menus()+) will expand items with such class instead of
|
19
|
+
# +:extra_class+:: String, add extra HTML/CSS class; you may also provide a space-separeted list of classes; NOTE: class +hmenu-selected+ is special: the JavaScript code from HMenu::JS.out (function +reset_menus()+) will expand items with such class instead of collapsing them.
|
20
20
|
#
|
21
21
|
# You can add any custom keys and use them later for any customization.
|
22
22
|
#
|
@@ -57,6 +57,7 @@ module HMenu
|
|
57
57
|
|
58
58
|
hmenu_content_class << " hmenu-root" if is_root?
|
59
59
|
|
60
|
+
# TODO: use displayed_name
|
60
61
|
if o
|
61
62
|
hmenu_content_class << ' ' << o[:extra_class] if o[:extra_class]
|
62
63
|
s << "<#{ctag} class=\"#{hmenu_content_class}\" title=\"#{(o[:desc] || '')}\">"
|
@@ -109,8 +110,13 @@ module HMenu
|
|
109
110
|
|
110
111
|
protected
|
111
112
|
|
113
|
+
def displayed_name
|
114
|
+
content and content[:name] or name.capitalize
|
115
|
+
end
|
116
|
+
|
112
117
|
def <=>(other) # for sorting
|
113
|
-
|
118
|
+
return displayed_name <=> other.displayed_name if n == other.n
|
119
|
+
return n <=> other.n
|
114
120
|
end
|
115
121
|
|
116
122
|
def n
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hierarchical_menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Guido De Rosa
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-11-08 00:00:00 +00:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -25,6 +26,7 @@ dependencies:
|
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 63
|
28
30
|
segments:
|
29
31
|
- 0
|
30
32
|
- 8
|
@@ -68,6 +70,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
70
|
requirements:
|
69
71
|
- - ">="
|
70
72
|
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
71
74
|
segments:
|
72
75
|
- 0
|
73
76
|
version: "0"
|
@@ -76,6 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
79
|
requirements:
|
77
80
|
- - ">="
|
78
81
|
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
79
83
|
segments:
|
80
84
|
- 0
|
81
85
|
version: "0"
|