easy_menu 0.2.2 → 0.3.0

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: e4f6990701058e22283c180fef8fe41a1ec80951
4
- data.tar.gz: 28e9fc33e9e1e32424885884bf9967ba8cc48129
3
+ metadata.gz: eff880680823c216010cbc9bf92e3bb050a1336d
4
+ data.tar.gz: e31cf70182254be782dcd09e0dc2c50bf36634fb
5
5
  SHA512:
6
- metadata.gz: 6a2f590cdc0d64bbeb095272a4008cccb46925382564126dfe0d9b102becbd82a5600c13ae2b35495ebea4c6abfbdcd2723d03389f80a5a9ad4cbb4c7cc41b15
7
- data.tar.gz: a6c806734115f44e2ceea6a437956c75b8948b1ec3c6b8e3b193b7273a78eef5db66db9dce63fe0d91f7cbc8293ed57bb2715920fe99c6bd1b95a37d423a40fa
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: url("/assets/checkbox_selected.png") no-repeat 5px center;
232
+ background: asset_url("checkbox_selected.png") no-repeat 5px center;
233
233
 
234
234
  &:hover {
235
- background: url("/assets/checkbox_selected_hovered.png") no-repeat 5px center;
235
+ background: asset_url("checkbox_selected_hovered.png") no-repeat 5px center;
236
236
  }
237
237
  }
238
238
  &:hover {
@@ -122,7 +122,7 @@
122
122
  }
123
123
  &.with_menu {
124
124
  .menu_bar_item .arrow{
125
- background: url('/assets/arrows.png') center 87px;
125
+ background: asset_url('arrows.png') center 87px;
126
126
  display: inline-block;
127
127
  margin-left: 3px;
128
128
  height: 10px;
data/lib/easy_menu.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  module EasyMenu
2
- require 'easy_menu_helpers'
3
- require 'easy_menu_configuration'
2
+ require 'menu_bar'
4
3
 
5
4
  class Engine < Rails::Engine
6
5
  end
@@ -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
- @content << mbc
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
- @content << MenuBarContent.new(config, mbi, options[:menu_bar_content])
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
- @content << MenuBarContent.new(config, mbi, options[:menu_bar_content])
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
- @content << MenuBarContent.new(config, mbt, merge_class(options[:menu_bar_content], config[:menu_bar_content_with_menu_class]))
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
- @content << MenuBarContent.new(config, s, options.reverse_merge(:remove_if_dangling => @options[:remove_dangling_separators]))
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] = options.delete(: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.2.2
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-01-28 00:00:00.000000000 Z
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.1
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