easy_menu 0.4.7 → 0.4.12

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8759a1d1562f56312050c1e8e7db83e73e9aa9d2c92dc18a3847546148c58b1e
4
+ data.tar.gz: c0fe823313e0b75b8264176afdffe51b216be07f5624ca5e8c62c7c2bae59682
5
+ SHA512:
6
+ metadata.gz: beb596c3949a343af3507ad5534eab05f238c278ed57ff608a8c06030ccc6d202831e33b910d7e765b62b82c67b28dbf2ecae4354925ff26ad36dad76a164198
7
+ data.tar.gz: 7f96ac76f673c4ed0a49e3cbb4d628dd9d80cc717128f3c91e58ae0057e27598e6e2f3e8b1ebc5775c96d6bf7221bb8e9382bef650dd754578bf3a62d3b51f9b
@@ -22,7 +22,7 @@ $(document).ready(function() {
22
22
  $(this).addClass('submitting');
23
23
  });
24
24
 
25
- // Allow users to open an close menus by clicking
25
+ // Allow users to open and close menus by clicking
26
26
  $(menuBarRootSelector + '.menu_bar_content.with_menu').removeClass('no_js');
27
27
  $(menuBarRootSelector + '.menu_bar_content.with_menu .menu_bar_item').click(function(){
28
28
  var mbc = $(this).closest('.menu_bar_content');
@@ -31,9 +31,14 @@ $(document).ready(function() {
31
31
  .find('.menu').trigger('opened')
32
32
  });
33
33
 
34
- // Close the menu if the user clicked outside
35
- $(document).click(function(event){
36
- if ($(event.target).closest('.menu_bar_content.with_menu .menu_bar_item').length > 0) { return } // Don't close the menus if the click came from a menu
34
+ // Close the menu when the user clicks or there is a form submission
35
+ $(document).on('click submit', function(event) {
36
+ // Don't close the menu if the click was on a menu_bar_item. This case is handled by the previous event handler
37
+ if ($(event.target).closest('.menu_bar_content.with_menu .menu_bar_item').length > 0) { return }
38
+
39
+ // Don't close if we clicked inside a menu but not on a menu_item
40
+ if ($(event.target).closest('.menu').length > 0 && $(event.target).closest('.menu_item').length === 0) { return }
41
+
37
42
  $(menuBarRootSelector + '.menu_bar_content.with_menu.open')
38
43
  .removeClass('open')
39
44
  .find('.menu').trigger('closed')
@@ -56,7 +56,7 @@ $menu-bar-item-pressed-zindex: 3;
56
56
 
57
57
  }
58
58
  @mixin gradient($start, $end){
59
- // IE 9+
59
+ // IE 9
60
60
  background-image: data_url('image/svg+xml', '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">
61
61
  <linearGradient id="grad-ucgg-generated" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%">
62
62
  <stop offset="0%" stop-color="#{$start}" stop-opacity="1"/>
@@ -64,30 +64,26 @@ $menu-bar-item-pressed-zindex: 3;
64
64
  </linearGradient>
65
65
  <rect x="0" y="0" width="1" height="1" fill="url(#grad-ucgg-generated)" />
66
66
  </svg>');
67
+ // IE 10+
68
+ background-image: -ms-linear-gradient(top, $start 0%, $end 100%);
67
69
 
68
70
  background-image: -moz-linear-gradient(top, $start 0%, $end 100%);
69
71
  background-image: -webkit-linear-gradient(top, $start 0%, $end 100%);
70
72
  background-image: linear-gradient(top, $start 0%, $end 100%);
71
73
  background-repeat: no-repeat;
72
74
  }
73
- @mixin button_colour($light, $dark, $text-colour: white, $text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25), $shift: 15px){
74
- color: $text-colour !important; // Make this important because host app may override hover colours, but we don't want to be affected
75
- text-shadow: $text-shadow;
76
- @include menu-bar-item-border($dark);
75
+ @mixin button_colour($light, $dark, $text-colour: white, $text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)){
76
+ color: $text-colour !important; // Make this important because host app may override hover colours, but we don't want to be affected
77
+ text-shadow: $text-shadow;
78
+ @include menu-bar-item-border($dark);
77
79
 
78
- background-color: mix($light, $dark);
80
+ background-color: mix($light, $dark);
79
81
 
80
- // Don't override the background if the browser doesn't support gradients otherwise the buttons will be too dark
81
- &:not(oldbrowser){
82
- @include gradient($light, $dark);
83
- background-color: $dark;
84
- }
85
-
86
- &:hover:not(:active):not(.disabled):not(.selected){
87
- -moz-transition: background-position 0.1s linear;
88
- -webkit-transition: background-position 0.1s linear;
89
- background-position: 0 (-$shift);
90
- }
82
+ // Don't override the background if the browser doesn't support gradients otherwise the buttons will be too dark
83
+ &:not(oldbrowser){
84
+ @include gradient($light, $dark);
85
+ background-color: $dark;
86
+ }
91
87
  }
92
88
 
93
89
  // STYLES
@@ -104,7 +100,7 @@ $menu-bar-item-pressed-zindex: 3;
104
100
  &.warning{ @include menu_bar_item_warning_colour }
105
101
  &.inverse{ @include menu_bar_item_inverse_colour }
106
102
 
107
- @include menu_bar_item_disabled;
103
+ &.disabled { @include menu_bar_item_disabled }
108
104
  }
109
105
 
110
106
  @mixin menu_bar_item_base{
@@ -147,13 +143,16 @@ $menu-bar-item-pressed-zindex: 3;
147
143
  left: -9999px;
148
144
  }
149
145
  }
150
- @mixin menu_bar_item_hover{
151
- &:hover{
146
+ @mixin menu_bar_item_hover($gradient-shift: 15px) {
147
+ &:hover:not(.disabled):not(.selected) {
152
148
  border-color: #888; // Fallback
153
149
  border-color: rgba(0,0,0, $menu-bar-item-border-darken * 2);
154
150
  border-bottom-color: rgba(0,0,0, $menu-bar-item-border-shadow-darken * 2);
155
151
  z-index: $menu-bar-item-hover-zindex;
156
- position: relative;
152
+
153
+ -moz-transition: background-position 0.1s linear;
154
+ -webkit-transition: background-position 0.1s linear;
155
+ background-position: 0 (-$gradient-shift);
157
156
  }
158
157
  }
159
158
  @mixin menu_bar_item_pressed{
@@ -167,14 +166,16 @@ $menu-bar-item-pressed-zindex: 3;
167
166
  }
168
167
 
169
168
  @mixin menu_bar_item_disabled{
170
- &.disabled{
171
- @include button_colour(#fefefe, #dddede, $menu-bar-item-disabled-text-color, 0 1px 1px rgba(255, 255, 255, 0.75));
172
- cursor: default;
169
+ @include button_colour(#fefefe, #dddede, $menu-bar-item-disabled-text-color, 0 1px 1px rgba(255, 255, 255, 0.75));
170
+ cursor: default;
171
+
172
+ &:active{
173
+ box-shadow: none;
173
174
  }
174
175
  }
175
176
 
176
177
  @mixin menu_bar_item_default_colour{
177
- @include button_colour($menu-bar-item-light-colour, $menu-bar-item-dark-colour, $menu-bar-item-text-color, 0 1px 1px rgba(255, 255, 255, 0.75), 5px);
178
+ @include button_colour($menu-bar-item-light-colour, $menu-bar-item-dark-colour, $menu-bar-item-text-color, 0 1px 1px rgba(255, 255, 255, 0.75));
178
179
  }
179
180
  @mixin menu_bar_item_danger_colour{
180
181
  @include button_colour(#EE5F5B, #BD362F);
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
5
- prerelease:
4
+ version: 0.4.12
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nicholas Jakobsen
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2015-05-13 00:00:00.000000000 Z
12
+ date: 2020-06-19 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ">="
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
@@ -34,42 +31,40 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
34
+ - MIT-LICENSE
35
+ - README
37
36
  - app/assets/images/icons.png
38
37
  - app/assets/javascripts/easy_menu_jquery.js
39
38
  - app/assets/javascripts/easy_menu_prototype.js
40
39
  - app/assets/stylesheets/_easy_menu_mixins.scss
41
40
  - app/assets/stylesheets/easy_menu.css.scss
42
41
  - app/helpers/menu_bar_helper.rb
42
+ - config/initializers/easy_menu_scss_extensions.rb
43
43
  - lib/easy_menu.rb
44
44
  - lib/easy_menu_configuration.rb
45
45
  - lib/easy_menu_helpers.rb
46
46
  - lib/menu_bar.rb
47
- - config/initializers/easy_menu_scss_extensions.rb
48
- - MIT-LICENSE
49
- - Gemfile
50
- - README
51
47
  homepage:
52
48
  licenses: []
49
+ metadata: {}
53
50
  post_install_message:
54
51
  rdoc_options: []
55
52
  require_paths:
56
53
  - lib
57
54
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
55
  requirements:
60
56
  - - ">="
61
57
  - !ruby/object:Gem::Version
62
58
  version: '0'
63
59
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
60
  requirements:
66
61
  - - ">="
67
62
  - !ruby/object:Gem::Version
68
63
  version: '0'
69
64
  requirements: []
70
65
  rubyforge_project:
71
- rubygems_version: 1.8.25
66
+ rubygems_version: 2.7.9
72
67
  signing_key:
73
- specification_version: 3
68
+ specification_version: 4
74
69
  summary: Simple menu bar dsl for Rails views
75
70
  test_files: []
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "http://rubygems.org"
2
- gem "rails", "~> 3.1.0"