easy_menu 0.2.2 → 0.3.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eff880680823c216010cbc9bf92e3bb050a1336d
|
4
|
+
data.tar.gz: e31cf70182254be782dcd09e0dc2c50bf36634fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e7c3839d7874d81a774f0bcbe1ff898d74aceb5bfc128367fdf6b43b36782aa489b2adcca5068bce3bfe928fecb04f9b9cd986f109e48c6d99d9a95cbaa8033
|
7
|
+
data.tar.gz: 8348be985f00988bcd56d5a4936e6bfa3cdbe0a3b96ac35d92952f579aaa0f784cc6bf24cda07a0d3ddbcf3f5de4e58eced2cefb104b68f851815e34cd7db826
|
@@ -229,10 +229,10 @@ $menu-bar-item-pressed-zindex: 3;
|
|
229
229
|
}
|
230
230
|
@mixin menu_item_hover {
|
231
231
|
&.selected a {
|
232
|
-
background:
|
232
|
+
background: asset_url("checkbox_selected.png") no-repeat 5px center;
|
233
233
|
|
234
234
|
&:hover {
|
235
|
-
background:
|
235
|
+
background: asset_url("checkbox_selected_hovered.png") no-repeat 5px center;
|
236
236
|
}
|
237
237
|
}
|
238
238
|
&:hover {
|
data/lib/easy_menu.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# TODO make menu bar group an actual group instead of a state toggle
|
2
|
+
require 'easy_menu_helpers'
|
3
|
+
require 'easy_menu_configuration'
|
4
|
+
|
2
5
|
class MenuBar
|
3
6
|
include EasyMenu::Helpers
|
4
7
|
include EasyMenu::Configuration
|
@@ -42,7 +45,8 @@ class MenuBar
|
|
42
45
|
end
|
43
46
|
|
44
47
|
mbc = MenuBarContent.new(config, content, options)
|
45
|
-
|
48
|
+
|
49
|
+
store_menu_bar_content(mbc)
|
46
50
|
|
47
51
|
return mbc
|
48
52
|
end
|
@@ -53,7 +57,9 @@ class MenuBar
|
|
53
57
|
raise if config[:template].is_a?(Hash) || config[:template].nil?
|
54
58
|
|
55
59
|
mbi = MenuBarItem.new config, content, options
|
56
|
-
|
60
|
+
mbc = MenuBarContent.new(config, mbi, options[:menu_bar_content])
|
61
|
+
|
62
|
+
store_menu_bar_content(mbc)
|
57
63
|
|
58
64
|
return mbi
|
59
65
|
end
|
@@ -63,7 +69,9 @@ class MenuBar
|
|
63
69
|
|
64
70
|
mbin = MenuBarInput.new config, content, options
|
65
71
|
mbi = MenuBarItem.new config, mbin, options[:menu_bar_item]
|
66
|
-
|
72
|
+
mbc = MenuBarContent.new(config, mbi, options[:menu_bar_content])
|
73
|
+
|
74
|
+
store_menu_bar_content(mbc)
|
67
75
|
|
68
76
|
return mbi
|
69
77
|
end
|
@@ -79,14 +87,18 @@ class MenuBar
|
|
79
87
|
yield m if block_given?
|
80
88
|
|
81
89
|
# We give the menu bar content a special class so we can treat its contents differently than one without a menu inside
|
82
|
-
|
90
|
+
mbc = MenuBarContent.new(config, mbt, merge_class(options[:menu_bar_content], config[:menu_bar_content_with_menu_class]))
|
91
|
+
|
92
|
+
store_menu_bar_content(mbc)
|
83
93
|
|
84
94
|
return m
|
85
95
|
end
|
86
96
|
|
87
97
|
def separator(options = {})
|
88
98
|
s = @template.content_tag :div, '', :class => config[:menu_bar_separator_class]
|
89
|
-
|
99
|
+
mbc = MenuBarContent.new(config, s, options.reverse_merge(:remove_if_dangling => @options[:remove_dangling_separators]))
|
100
|
+
|
101
|
+
store_menu_bar_content(mbc)
|
90
102
|
|
91
103
|
return s
|
92
104
|
end
|
@@ -103,7 +115,7 @@ class MenuBar
|
|
103
115
|
options[:menu_bar_content] ||= {}
|
104
116
|
|
105
117
|
# Alignment always lies with the content wrapper
|
106
|
-
options[:menu_bar_content][:align]
|
118
|
+
options[:menu_bar_content][:align] ||= options.delete(:align)
|
107
119
|
|
108
120
|
return options
|
109
121
|
end
|
@@ -118,6 +130,15 @@ class MenuBar
|
|
118
130
|
return html_opts
|
119
131
|
end
|
120
132
|
|
133
|
+
# Ensure that right aligned menu bar content appears on the page in the order it is inserted
|
134
|
+
def store_menu_bar_content(mbc)
|
135
|
+
if mbc.options[:align].to_s == 'right'
|
136
|
+
@content.prepend(mbc)
|
137
|
+
else
|
138
|
+
@content << mbc
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
121
142
|
# ABSTRACT CLASSES
|
122
143
|
|
123
144
|
class AbstractContent
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Jakobsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -41,12 +41,12 @@ files:
|
|
41
41
|
- app/assets/javascripts/easy_menu_prototype.js
|
42
42
|
- app/assets/stylesheets/_easy_menu_mixins.scss
|
43
43
|
- app/assets/stylesheets/easy_menu.css.scss
|
44
|
-
- app/helpers/menu_bar.rb
|
45
44
|
- app/helpers/menu_bar_helper.rb
|
46
45
|
- config/initializers/easy_menu_scss_extensions.rb
|
47
46
|
- lib/easy_menu.rb
|
48
47
|
- lib/easy_menu_configuration.rb
|
49
48
|
- lib/easy_menu_helpers.rb
|
49
|
+
- lib/menu_bar.rb
|
50
50
|
homepage:
|
51
51
|
licenses: []
|
52
52
|
metadata: {}
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
68
|
rubyforge_project:
|
69
|
-
rubygems_version: 2.2.
|
69
|
+
rubygems_version: 2.2.2
|
70
70
|
signing_key:
|
71
71
|
specification_version: 4
|
72
72
|
summary: Simple menu bar dsl for Rails views
|