foundation-rails 6.2.1.0 → 6.2.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bower.json +1 -1
  4. data/lib/foundation/rails/version.rb +1 -1
  5. data/lib/generators/foundation/templates/_settings.scss +1 -1
  6. data/vendor/assets/js/foundation.abide.js.es6 +27 -11
  7. data/vendor/assets/js/foundation.accordion.js.es6 +1 -1
  8. data/vendor/assets/js/foundation.accordionMenu.js.es6 +10 -7
  9. data/vendor/assets/js/foundation.core.js.es6 +3 -3
  10. data/vendor/assets/js/foundation.drilldown.js.es6 +31 -23
  11. data/vendor/assets/js/foundation.dropdown.js.es6 +1 -1
  12. data/vendor/assets/js/foundation.dropdownMenu.js.es6 +34 -26
  13. data/vendor/assets/js/foundation.equalizer.js.es6 +27 -6
  14. data/vendor/assets/js/foundation.interchange.js.es6 +22 -16
  15. data/vendor/assets/js/foundation.magellan.js.es6 +1 -1
  16. data/vendor/assets/js/foundation.offcanvas.js.es6 +6 -3
  17. data/vendor/assets/js/foundation.responsiveToggle.js.es6 +10 -3
  18. data/vendor/assets/js/foundation.reveal.js.es6 +53 -35
  19. data/vendor/assets/js/foundation.slider.js.es6 +31 -11
  20. data/vendor/assets/js/foundation.sticky.js.es6 +30 -27
  21. data/vendor/assets/js/foundation.tabs.js.es6 +13 -5
  22. data/vendor/assets/js/foundation.tooltip.js.es6 +12 -6
  23. data/vendor/assets/js/foundation.util.box.js.es6 +1 -1
  24. data/vendor/assets/js/foundation.util.keyboard.js.es6 +3 -3
  25. data/vendor/assets/js/foundation.util.mediaQuery.js.es6 +15 -11
  26. data/vendor/assets/js/foundation.util.touch.js.es6 +1 -1
  27. data/vendor/assets/scss/components/_accordion.scss +27 -7
  28. data/vendor/assets/scss/components/_button-group.scss +15 -23
  29. data/vendor/assets/scss/components/_button.scss +5 -0
  30. data/vendor/assets/scss/components/_dropdown-menu.scss +16 -5
  31. data/vendor/assets/scss/components/_media-object.scss +8 -2
  32. data/vendor/assets/scss/components/_menu.scss +9 -7
  33. data/vendor/assets/scss/components/_reveal.scss +7 -0
  34. data/vendor/assets/scss/components/_title-bar.scss +1 -1
  35. data/vendor/assets/scss/forms/_input-group.scss +1 -0
  36. data/vendor/assets/scss/forms/_select.scss +2 -1
  37. data/vendor/assets/scss/foundation.scss +1 -1
  38. data/vendor/assets/scss/grid/_classes.scss +2 -1
  39. data/vendor/assets/scss/grid/_flex-grid.scss +1 -1
  40. data/vendor/assets/scss/grid/_position.scss +1 -1
  41. data/vendor/assets/scss/grid/_row.scss +1 -1
  42. data/vendor/assets/scss/settings/_settings.scss +1 -1
  43. data/vendor/assets/scss/util/_breakpoint.scss +4 -3
  44. data/vendor/assets/scss/util/_mixins.scss +1 -1
  45. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 735a8b397ebc1435c95895db256eabe72558bddc
4
- data.tar.gz: b97f18f8a1af0bb11365fce4242b1b774f57d2ae
3
+ metadata.gz: f32f3823c38823acc3571855ddeeabbdd1dd590e
4
+ data.tar.gz: d709d42eeede630436458e26a802af0b1f55e946
5
5
  SHA512:
6
- metadata.gz: 71b375d65052824afddfc3a27e683e45bca0e3fe5fa3acc18881fab0ba5a1341c5bdd1915c1f499d3628ed698108e05959717c1c0de72a2d038127259eff3e64
7
- data.tar.gz: af520a6d6be8af26d4f1137d6bb64d71b62d4f8c8f35fed8d0e551eb45c1c95036f4b1b7a840214ea1f466cc001e5a2c1b288dd04a0ffc372423f67dfdf99aca
6
+ metadata.gz: c0113fcb9e16914f67ab0e7565e221fe485cdee87d03dc6644663cf876021533cb57f6efdb4df65bb3fc10d5118dbc22edf51273c281dd1f43b3f4f74e384353
7
+ data.tar.gz: 120e60d9f7bbc4a2e6a6f89bef65ec893ba6ac962c8aa2136db96e1d49b312e92bc2f800f5d238aef8992aa4064dc2759417159e3152b286524946fa44a7c834
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- $ gem 'foundation-rails'
11
+ gem 'foundation-rails'
12
12
 
13
13
  And then execute:
14
14
 
data/bower.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "foundation-rails",
3
3
  "version": "6.2.1.0",
4
4
  "dependencies": {
5
- "foundation-sites": "6.2.1",
5
+ "foundation-sites": "6.2.3",
6
6
  "motion-ui": "1.2.2"
7
7
  }
8
8
  }
@@ -1,5 +1,5 @@
1
1
  module Foundation
2
2
  module Rails
3
- VERSION = "6.2.1.0"
3
+ VERSION = "6.2.3.0"
4
4
  end
5
5
  end
@@ -200,7 +200,7 @@ $accordion-item-background-hover: $light-gray;
200
200
  $accordion-item-padding: 1.25rem 1rem;
201
201
  $accordion-content-background: $white;
202
202
  $accordion-content-border: 1px solid $light-gray;
203
- $accordion-content-color: foreground($accordion-background, $primary-color);
203
+ $accordion-content-color: foreground($accordion-content-background, $body-font-color);
204
204
  $accordion-content-padding: 1rem;
205
205
 
206
206
  // 8. Accordion Menu
@@ -29,7 +29,7 @@ class Abide {
29
29
  * @private
30
30
  */
31
31
  _init() {
32
- this.$inputs = this.$element.find('input, textarea, select').not('[data-abide-ignore]');
32
+ this.$inputs = this.$element.find('input, textarea, select');
33
33
 
34
34
  this._events();
35
35
  }
@@ -83,6 +83,10 @@ class Abide {
83
83
  var isGood = true;
84
84
 
85
85
  switch ($el[0].type) {
86
+ case 'checkbox':
87
+ isGood = $el[0].checked;
88
+ break;
89
+
86
90
  case 'select':
87
91
  case 'select-one':
88
92
  case 'select-multiple':
@@ -238,6 +242,11 @@ class Abide {
238
242
  validator = $el.attr('data-validator'),
239
243
  equalTo = true;
240
244
 
245
+ // don't validate ignored inputs or hidden inputs
246
+ if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]')) {
247
+ return true;
248
+ }
249
+
241
250
  switch ($el[0].type) {
242
251
  case 'radio':
243
252
  validated = this.validateRadio($el.attr('name'));
@@ -353,19 +362,24 @@ class Abide {
353
362
  // If at least one radio in the group has the `required` attribute, the group is considered required
354
363
  // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
355
364
  var $group = this.$element.find(`:radio[name="${groupName}"]`);
356
- var valid = false;
365
+ var valid = false, required = false;
357
366
 
358
- // .attr() returns undefined if no elements in $group have the attribute "required"
359
- if ($group.attr('required') === undefined) {
360
- valid = true;
361
- }
362
-
363
- // For the group to be valid, at least one radio needs to be checked
367
+ // For the group to be required, at least one radio needs to be required
364
368
  $group.each((i, e) => {
365
- if ($(e).prop('checked')) {
366
- valid = true;
369
+ if ($(e).attr('required')) {
370
+ required = true;
367
371
  }
368
372
  });
373
+ if(!required) valid=true;
374
+
375
+ if (!valid) {
376
+ // For the group to be valid, at least one radio needs to be checked
377
+ $group.each((i, e) => {
378
+ if ($(e).prop('checked')) {
379
+ valid = true;
380
+ }
381
+ });
382
+ };
369
383
 
370
384
  return valid;
371
385
  }
@@ -398,7 +412,9 @@ class Abide {
398
412
  $(`.${opts.inputErrorClass}`, $form).not('small').removeClass(opts.inputErrorClass);
399
413
  $(`${opts.formErrorSelector}.${opts.formErrorClass}`).removeClass(opts.formErrorClass);
400
414
  $form.find('[data-abide-error]').css('display', 'none');
401
- $(':input', $form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr('data-invalid');
415
+ $(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').removeAttr('data-invalid');
416
+ $(':input:radio', $form).not('[data-abide-ignore]').prop('checked',false).removeAttr('data-invalid');
417
+ $(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked',false).removeAttr('data-invalid');
402
418
  /**
403
419
  * Fires when the form has been reset.
404
420
  * @event Abide#formreset
@@ -203,7 +203,7 @@ class Accordion {
203
203
  * @function
204
204
  */
205
205
  destroy() {
206
- this.$element.find('[data-tab-content]').slideUp(0).css('display', '');
206
+ this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
207
207
  this.$element.find('a').off('.zf.accordion');
208
208
 
209
209
  Foundation.unregisterPlugin(this);
@@ -144,11 +144,11 @@ class AccordionMenu {
144
144
  },
145
145
  up: function() {
146
146
  $prevElement.attr('tabindex', -1).focus();
147
- e.preventDefault();
147
+ return true;
148
148
  },
149
149
  down: function() {
150
150
  $nextElement.attr('tabindex', -1).focus();
151
- e.preventDefault();
151
+ return true;
152
152
  },
153
153
  toggle: function() {
154
154
  if ($element.children('[data-submenu]').length) {
@@ -158,7 +158,10 @@ class AccordionMenu {
158
158
  closeAll: function() {
159
159
  _this.hideAll();
160
160
  },
161
- handled: function() {
161
+ handled: function(preventDefault) {
162
+ if (preventDefault) {
163
+ e.preventDefault();
164
+ }
162
165
  e.stopImmediatePropagation();
163
166
  }
164
167
  });
@@ -204,7 +207,7 @@ class AccordionMenu {
204
207
  $target.addClass('is-active').attr({'aria-hidden': false})
205
208
  .parent('.is-accordion-submenu-parent').attr({'aria-expanded': true});
206
209
 
207
- Foundation.Move(this.options.slideSpeed, $target, function() {
210
+ //Foundation.Move(this.options.slideSpeed, $target, function() {
208
211
  $target.slideDown(_this.options.slideSpeed, function () {
209
212
  /**
210
213
  * Fires when the menu is done opening.
@@ -212,7 +215,7 @@ class AccordionMenu {
212
215
  */
213
216
  _this.$element.trigger('down.zf.accordionMenu', [$target]);
214
217
  });
215
- });
218
+ //});
216
219
  }
217
220
 
218
221
  /**
@@ -222,7 +225,7 @@ class AccordionMenu {
222
225
  */
223
226
  up($target) {
224
227
  var _this = this;
225
- Foundation.Move(this.options.slideSpeed, $target, function(){
228
+ //Foundation.Move(this.options.slideSpeed, $target, function(){
226
229
  $target.slideUp(_this.options.slideSpeed, function () {
227
230
  /**
228
231
  * Fires when the menu is done collapsing up.
@@ -230,7 +233,7 @@ class AccordionMenu {
230
233
  */
231
234
  _this.$element.trigger('up.zf.accordionMenu', [$target]);
232
235
  });
233
- });
236
+ //});
234
237
 
235
238
  var $menus = $target.find('[data-submenu]').slideUp(0).addBack().attr('aria-hidden', true);
236
239
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- var FOUNDATION_VERSION = '6.2.1';
5
+ var FOUNDATION_VERSION = '6.2.2';
6
6
 
7
7
  // Global Foundation object
8
8
  // This is attached to the window, or used as a module for AMD/Browserify
@@ -44,7 +44,7 @@ var Foundation = {
44
44
  * @function
45
45
  * Populates the _uuids array with pointers to each individual plugin instance.
46
46
  * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.
47
- * Also fires the initialization event for each plugin, consolidating repeditive code.
47
+ * Also fires the initialization event for each plugin, consolidating repetitive code.
48
48
  * @param {Object} plugin - an instance of a plugin, usually `this` in context.
49
49
  * @param {String} name - the name of the plugin, passed as a camelCased string.
50
50
  * @fires Plugin#init
@@ -69,7 +69,7 @@ var Foundation = {
69
69
  * @function
70
70
  * Removes the plugins uuid from the _uuids array.
71
71
  * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.
72
- * Also fires the destroyed event for the plugin, consolidating repeditive code.
72
+ * Also fires the destroyed event for the plugin, consolidating repetitive code.
73
73
  * @param {Object} plugin - an instance of a plugin, usually `this` in context.
74
74
  * @fires Plugin#destroyed
75
75
  */
@@ -66,19 +66,19 @@ class Drilldown {
66
66
  // this._menuLinkEvents();
67
67
  // }
68
68
  this.$submenuAnchors.each(function(){
69
- var $sub = $(this);
70
- var $link = $sub.find('a:first');
69
+ var $link = $(this);
70
+ var $sub = $link.parent();
71
71
  if(_this.options.parentLink){
72
72
  $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menu-item"></li>');
73
73
  }
74
74
  $link.data('savedHref', $link.attr('href')).removeAttr('href');
75
- $sub.children('[data-submenu]')
75
+ $link.children('[data-submenu]')
76
76
  .attr({
77
77
  'aria-hidden': true,
78
78
  'tabindex': 0,
79
79
  'role': 'menu'
80
80
  });
81
- _this._events($sub);
81
+ _this._events($link);
82
82
  });
83
83
  this.$submenus.each(function(){
84
84
  var $menu = $(this),
@@ -89,8 +89,8 @@ class Drilldown {
89
89
  _this._back($menu);
90
90
  });
91
91
  if(!this.$element.parent().hasClass('is-drilldown')){
92
- this.$wrapper = $(this.options.wrapper).addClass('is-drilldown').css(this._getMaxDims());
93
- this.$element.wrap(this.$wrapper);
92
+ this.$wrapper = $(this.options.wrapper).addClass('is-drilldown');
93
+ this.$wrapper = this.$element.wrap(this.$wrapper).parent().css(this._getMaxDims());
94
94
  }
95
95
  }
96
96
 
@@ -116,8 +116,9 @@ class Drilldown {
116
116
  _this._show($elem.parent('li'));
117
117
 
118
118
  if(_this.options.closeOnClick){
119
- var $body = $('body').not(_this.$wrapper);
119
+ var $body = $('body');
120
120
  $body.off('.zf.drilldown').on('click.zf.drilldown', function(e){
121
+ if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; }
121
122
  e.preventDefault();
122
123
  _this._hideAll();
123
124
  $body.off('.zf.drilldown');
@@ -132,9 +133,9 @@ class Drilldown {
132
133
  */
133
134
  _keyboardEvents() {
134
135
  var _this = this;
135
-
136
+
136
137
  this.$menuItems.add(this.$element.find('.js-drilldown-back > a')).on('keydown.zf.drilldown', function(e){
137
-
138
+
138
139
  var $element = $(this),
139
140
  $elements = $element.parent('li').parent('ul').children('li').children('a'),
140
141
  $prevElement,
@@ -155,7 +156,7 @@ class Drilldown {
155
156
  $element.parent('li').one(Foundation.transitionend($element), function(){
156
157
  $element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
157
158
  });
158
- e.preventDefault();
159
+ return true;
159
160
  }
160
161
  },
161
162
  previous: function() {
@@ -165,15 +166,15 @@ class Drilldown {
165
166
  $element.parent('li').parent('ul').parent('li').children('a').first().focus();
166
167
  }, 1);
167
168
  });
168
- e.preventDefault();
169
+ return true;
169
170
  },
170
171
  up: function() {
171
172
  $prevElement.focus();
172
- e.preventDefault();
173
+ return true;
173
174
  },
174
175
  down: function() {
175
176
  $nextElement.focus();
176
- e.preventDefault();
177
+ return true;
177
178
  },
178
179
  close: function() {
179
180
  _this._back();
@@ -186,17 +187,19 @@ class Drilldown {
186
187
  setTimeout(function() {
187
188
  $element.parent('li').parent('ul').parent('li').children('a').first().focus();
188
189
  }, 1);
189
- });
190
- e.preventDefault();
190
+ });
191
191
  } else if ($element.is(_this.$submenuAnchors)) {
192
192
  _this._show($element.parent('li'));
193
193
  $element.parent('li').one(Foundation.transitionend($element), function(){
194
194
  $element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
195
- });
196
- e.preventDefault();
195
+ });
197
196
  }
197
+ return true;
198
198
  },
199
- handled: function() {
199
+ handled: function(preventDefault) {
200
+ if (preventDefault) {
201
+ e.preventDefault();
202
+ }
200
203
  e.stopImmediatePropagation();
201
204
  }
202
205
  });
@@ -262,7 +265,10 @@ class Drilldown {
262
265
  */
263
266
  _show($elem) {
264
267
  $elem.children('[data-submenu]').addClass('is-active');
265
-
268
+ /**
269
+ * Fires when the submenu has opened.
270
+ * @event Drilldown#open
271
+ */
266
272
  this.$element.trigger('open.zf.drilldown', [$elem]);
267
273
  };
268
274
 
@@ -280,7 +286,7 @@ class Drilldown {
280
286
  $elem.blur();
281
287
  });
282
288
  /**
283
- * Fires when the submenu is has closed.
289
+ * Fires when the submenu has closed.
284
290
  * @event Drilldown#hide
285
291
  */
286
292
  $elem.trigger('hide.zf.drilldown', [$elem]);
@@ -315,8 +321,10 @@ class Drilldown {
315
321
  this.$element.unwrap()
316
322
  .find('.js-drilldown-back, .is-submenu-parent-item').remove()
317
323
  .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')
318
- .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role')
319
- .off('.zf.drilldown').end().off('zf.drilldown');
324
+ .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');
325
+ this.$submenuAnchors.each(function() {
326
+ $(this).off('.zf.drilldown');
327
+ });
320
328
  this.$element.find('a').each(function(){
321
329
  var $link = $(this);
322
330
  if($link.data('savedHref')){
@@ -358,4 +366,4 @@ Drilldown.defaults = {
358
366
  // Window exports
359
367
  Foundation.plugin(Drilldown, 'Drilldown');
360
368
 
361
- }(jQuery);
369
+ }(jQuery);
@@ -71,7 +71,7 @@ class Dropdown {
71
71
  getPositionClass() {
72
72
  var verticalPosition = this.$element[0].className.match(/(top|left|right|bottom)/g);
73
73
  verticalPosition = verticalPosition ? verticalPosition[0] : '';
74
- var horizontalPosition = /float-(.+)\s/.exec(this.$anchor[0].className);
74
+ var horizontalPosition = /float-(\S+)\s/.exec(this.$anchor[0].className);
75
75
  horizontalPosition = horizontalPosition ? horizontalPosition[1] : '';
76
76
  var position = horizontalPosition ? horizontalPosition + ' ' + verticalPosition : verticalPosition;
77
77
  return position;
@@ -69,34 +69,36 @@ class DropdownMenu {
69
69
  hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined'),
70
70
  parClass = 'is-dropdown-submenu-parent';
71
71
 
72
- if (this.options.clickOpen || hasTouch) {
73
- this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', function(e) {
74
- var $elem = $(e.target).parentsUntil('ul', `.${parClass}`),
75
- hasSub = $elem.hasClass(parClass),
76
- hasClicked = $elem.attr('data-is-click') === 'true',
77
- $sub = $elem.children('.is-dropdown-submenu');
72
+ // used for onClick and in the keyboard handlers
73
+ var handleClickFn = function(e) {
74
+ var $elem = $(e.target).parentsUntil('ul', `.${parClass}`),
75
+ hasSub = $elem.hasClass(parClass),
76
+ hasClicked = $elem.attr('data-is-click') === 'true',
77
+ $sub = $elem.children('.is-dropdown-submenu');
78
78
 
79
- if (hasSub) {
80
- if (hasClicked) {
81
- if (!_this.options.closeOnClick || (!_this.options.clickOpen && !hasTouch) || (_this.options.forceFollow && hasTouch)) { return; }
82
- else {
83
- e.stopImmediatePropagation();
84
- e.preventDefault();
85
- _this._hide($elem);
86
- }
87
- } else {
88
- e.preventDefault();
79
+ if (hasSub) {
80
+ if (hasClicked) {
81
+ if (!_this.options.closeOnClick || (!_this.options.clickOpen && !hasTouch) || (_this.options.forceFollow && hasTouch)) { return; }
82
+ else {
89
83
  e.stopImmediatePropagation();
90
- _this._show($elem.children('.is-dropdown-submenu'));
91
- $elem.add($elem.parentsUntil(_this.$element, `.${parClass}`)).attr('data-is-click', true);
84
+ e.preventDefault();
85
+ _this._hide($elem);
92
86
  }
93
- } else { return; }
94
- });
87
+ } else {
88
+ e.preventDefault();
89
+ e.stopImmediatePropagation();
90
+ _this._show($elem.children('.is-dropdown-submenu'));
91
+ $elem.add($elem.parentsUntil(_this.$element, `.${parClass}`)).attr('data-is-click', true);
92
+ }
93
+ } else { return; }
94
+ };
95
+
96
+ if (this.options.clickOpen || hasTouch) {
97
+ this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn);
95
98
  }
96
99
 
97
100
  if (!this.options.disableHover) {
98
101
  this.$menuItems.on('mouseenter.zf.dropdownmenu', function(e) {
99
- e.stopImmediatePropagation();
100
102
  var $elem = $(this),
101
103
  hasSub = $elem.hasClass(parClass);
102
104
 
@@ -135,20 +137,26 @@ class DropdownMenu {
135
137
  });
136
138
 
137
139
  var nextSibling = function() {
138
- if (!$element.is(':last-child')) $nextElement.children('a:first').focus();
140
+ if (!$element.is(':last-child')) {
141
+ $nextElement.children('a:first').focus();
142
+ e.preventDefault();
143
+ }
139
144
  }, prevSibling = function() {
140
145
  $prevElement.children('a:first').focus();
146
+ e.preventDefault();
141
147
  }, openSub = function() {
142
148
  var $sub = $element.children('ul.is-dropdown-submenu');
143
149
  if ($sub.length) {
144
150
  _this._show($sub);
145
151
  $element.find('li > a:first').focus();
152
+ e.preventDefault();
146
153
  } else { return; }
147
154
  }, closeSub = function() {
148
155
  //if ($element.is(':first-child')) {
149
156
  var close = $element.parent('ul').parent('li');
150
- close.children('a:first').focus();
151
- _this._hide(close);
157
+ close.children('a:first').focus();
158
+ _this._hide(close);
159
+ e.preventDefault();
152
160
  //}
153
161
  };
154
162
  var functions = {
@@ -156,15 +164,15 @@ class DropdownMenu {
156
164
  close: function() {
157
165
  _this._hide(_this.$element);
158
166
  _this.$menuItems.find('a:first').focus(); // focus to first element
167
+ e.preventDefault();
159
168
  },
160
169
  handled: function() {
161
- e.preventDefault();
162
170
  e.stopImmediatePropagation();
163
171
  }
164
172
  };
165
173
 
166
174
  if (isTab) {
167
- if (_this.vertical) { // vertical menu
175
+ if (_this.$element.hasClass(_this.options.verticalClass)) { // vertical menu
168
176
  if (_this.options.alignment === 'left') { // left aligned
169
177
  $.extend(functions, {
170
178
  down: nextSibling,