Skip to content

Commit fdbe9b5

Browse files
committed
Merge pull request #191 from zurb/6.2.3-update
Update assets to 6.2.3
2 parents 114b9bc + ed55723 commit fdbe9b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+438
-260
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "foundation-rails",
33
"version": "6.2.1.0",
44
"dependencies": {
5-
"foundation-sites": "6.2.1",
5+
"foundation-sites": "6.2.3",
66
"motion-ui": "1.2.2"
77
}
88
}

lib/foundation/rails/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Foundation
22
module Rails
3-
VERSION = "6.2.1.0"
3+
VERSION = "6.2.3.0"
44
end
55
end

lib/generators/foundation/templates/_settings.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ $accordion-item-background-hover: $light-gray;
200200
$accordion-item-padding: 1.25rem 1rem;
201201
$accordion-content-background: $white;
202202
$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);
204204
$accordion-content-padding: 1rem;
205205

206206
// 8. Accordion Menu

vendor/assets/js/foundation.abide.js.es6

+27-11
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Abide {
2929
* @private
3030
*/
3131
_init() {
32-
this.$inputs = this.$element.find('input, textarea, select').not('[data-abide-ignore]');
32+
this.$inputs = this.$element.find('input, textarea, select');
3333

3434
this._events();
3535
}
@@ -83,6 +83,10 @@ class Abide {
8383
var isGood = true;
8484

8585
switch ($el[0].type) {
86+
case 'checkbox':
87+
isGood = $el[0].checked;
88+
break;
89+
8690
case 'select':
8791
case 'select-one':
8892
case 'select-multiple':
@@ -238,6 +242,11 @@ class Abide {
238242
validator = $el.attr('data-validator'),
239243
equalTo = true;
240244

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+
241250
switch ($el[0].type) {
242251
case 'radio':
243252
validated = this.validateRadio($el.attr('name'));
@@ -353,19 +362,24 @@ class Abide {
353362
// If at least one radio in the group has the `required` attribute, the group is considered required
354363
// Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
355364
var $group = this.$element.find(`:radio[name="${groupName}"]`);
356-
var valid = false;
365+
var valid = false, required = false;
357366

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
364368
$group.each((i, e) => {
365-
if ($(e).prop('checked')) {
366-
valid = true;
369+
if ($(e).attr('required')) {
370+
required = true;
367371
}
368372
});
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+
};
369383

370384
return valid;
371385
}
@@ -398,7 +412,9 @@ class Abide {
398412
$(`.${opts.inputErrorClass}`, $form).not('small').removeClass(opts.inputErrorClass);
399413
$(`${opts.formErrorSelector}.${opts.formErrorClass}`).removeClass(opts.formErrorClass);
400414
$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');
402418
/**
403419
* Fires when the form has been reset.
404420
* @event Abide#formreset

vendor/assets/js/foundation.accordion.js.es6

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Accordion {
203203
* @function
204204
*/
205205
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', '');
207207
this.$element.find('a').off('.zf.accordion');
208208

209209
Foundation.unregisterPlugin(this);

vendor/assets/js/foundation.accordionMenu.js.es6

+10-7
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ class AccordionMenu {
144144
},
145145
up: function() {
146146
$prevElement.attr('tabindex', -1).focus();
147-
e.preventDefault();
147+
return true;
148148
},
149149
down: function() {
150150
$nextElement.attr('tabindex', -1).focus();
151-
e.preventDefault();
151+
return true;
152152
},
153153
toggle: function() {
154154
if ($element.children('[data-submenu]').length) {
@@ -158,7 +158,10 @@ class AccordionMenu {
158158
closeAll: function() {
159159
_this.hideAll();
160160
},
161-
handled: function() {
161+
handled: function(preventDefault) {
162+
if (preventDefault) {
163+
e.preventDefault();
164+
}
162165
e.stopImmediatePropagation();
163166
}
164167
});
@@ -204,15 +207,15 @@ class AccordionMenu {
204207
$target.addClass('is-active').attr({'aria-hidden': false})
205208
.parent('.is-accordion-submenu-parent').attr({'aria-expanded': true});
206209

207-
Foundation.Move(this.options.slideSpeed, $target, function() {
210+
//Foundation.Move(this.options.slideSpeed, $target, function() {
208211
$target.slideDown(_this.options.slideSpeed, function () {
209212
/**
210213
* Fires when the menu is done opening.
211214
* @event AccordionMenu#down
212215
*/
213216
_this.$element.trigger('down.zf.accordionMenu', [$target]);
214217
});
215-
});
218+
//});
216219
}
217220

218221
/**
@@ -222,15 +225,15 @@ class AccordionMenu {
222225
*/
223226
up($target) {
224227
var _this = this;
225-
Foundation.Move(this.options.slideSpeed, $target, function(){
228+
//Foundation.Move(this.options.slideSpeed, $target, function(){
226229
$target.slideUp(_this.options.slideSpeed, function () {
227230
/**
228231
* Fires when the menu is done collapsing up.
229232
* @event AccordionMenu#up
230233
*/
231234
_this.$element.trigger('up.zf.accordionMenu', [$target]);
232235
});
233-
});
236+
//});
234237

235238
var $menus = $target.find('[data-submenu]').slideUp(0).addBack().attr('aria-hidden', true);
236239

vendor/assets/js/foundation.core.js.es6

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"use strict";
44

5-
var FOUNDATION_VERSION = '6.2.1';
5+
var FOUNDATION_VERSION = '6.2.2';
66

77
// Global Foundation object
88
// This is attached to the window, or used as a module for AMD/Browserify
@@ -44,7 +44,7 @@ var Foundation = {
4444
* @function
4545
* Populates the _uuids array with pointers to each individual plugin instance.
4646
* 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.
4848
* @param {Object} plugin - an instance of a plugin, usually `this` in context.
4949
* @param {String} name - the name of the plugin, passed as a camelCased string.
5050
* @fires Plugin#init
@@ -69,7 +69,7 @@ var Foundation = {
6969
* @function
7070
* Removes the plugins uuid from the _uuids array.
7171
* 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.
7373
* @param {Object} plugin - an instance of a plugin, usually `this` in context.
7474
* @fires Plugin#destroyed
7575
*/

vendor/assets/js/foundation.drilldown.js.es6

+31-23
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ class Drilldown {
6666
// this._menuLinkEvents();
6767
// }
6868
this.$submenuAnchors.each(function(){
69-
var $sub = $(this);
70-
var $link = $sub.find('a:first');
69+
var $link = $(this);
70+
var $sub = $link.parent();
7171
if(_this.options.parentLink){
7272
$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>');
7373
}
7474
$link.data('savedHref', $link.attr('href')).removeAttr('href');
75-
$sub.children('[data-submenu]')
75+
$link.children('[data-submenu]')
7676
.attr({
7777
'aria-hidden': true,
7878
'tabindex': 0,
7979
'role': 'menu'
8080
});
81-
_this._events($sub);
81+
_this._events($link);
8282
});
8383
this.$submenus.each(function(){
8484
var $menu = $(this),
@@ -89,8 +89,8 @@ class Drilldown {
8989
_this._back($menu);
9090
});
9191
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());
9494
}
9595
}
9696

@@ -116,8 +116,9 @@ class Drilldown {
116116
_this._show($elem.parent('li'));
117117

118118
if(_this.options.closeOnClick){
119-
var $body = $('body').not(_this.$wrapper);
119+
var $body = $('body');
120120
$body.off('.zf.drilldown').on('click.zf.drilldown', function(e){
121+
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; }
121122
e.preventDefault();
122123
_this._hideAll();
123124
$body.off('.zf.drilldown');
@@ -132,9 +133,9 @@ class Drilldown {
132133
*/
133134
_keyboardEvents() {
134135
var _this = this;
135-
136+
136137
this.$menuItems.add(this.$element.find('.js-drilldown-back > a')).on('keydown.zf.drilldown', function(e){
137-
138+
138139
var $element = $(this),
139140
$elements = $element.parent('li').parent('ul').children('li').children('a'),
140141
$prevElement,
@@ -155,7 +156,7 @@ class Drilldown {
155156
$element.parent('li').one(Foundation.transitionend($element), function(){
156157
$element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
157158
});
158-
e.preventDefault();
159+
return true;
159160
}
160161
},
161162
previous: function() {
@@ -165,15 +166,15 @@ class Drilldown {
165166
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
166167
}, 1);
167168
});
168-
e.preventDefault();
169+
return true;
169170
},
170171
up: function() {
171172
$prevElement.focus();
172-
e.preventDefault();
173+
return true;
173174
},
174175
down: function() {
175176
$nextElement.focus();
176-
e.preventDefault();
177+
return true;
177178
},
178179
close: function() {
179180
_this._back();
@@ -186,17 +187,19 @@ class Drilldown {
186187
setTimeout(function() {
187188
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
188189
}, 1);
189-
});
190-
e.preventDefault();
190+
});
191191
} else if ($element.is(_this.$submenuAnchors)) {
192192
_this._show($element.parent('li'));
193193
$element.parent('li').one(Foundation.transitionend($element), function(){
194194
$element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
195-
});
196-
e.preventDefault();
195+
});
197196
}
197+
return true;
198198
},
199-
handled: function() {
199+
handled: function(preventDefault) {
200+
if (preventDefault) {
201+
e.preventDefault();
202+
}
200203
e.stopImmediatePropagation();
201204
}
202205
});
@@ -262,7 +265,10 @@ class Drilldown {
262265
*/
263266
_show($elem) {
264267
$elem.children('[data-submenu]').addClass('is-active');
265-
268+
/**
269+
* Fires when the submenu has opened.
270+
* @event Drilldown#open
271+
*/
266272
this.$element.trigger('open.zf.drilldown', [$elem]);
267273
};
268274

@@ -280,7 +286,7 @@ class Drilldown {
280286
$elem.blur();
281287
});
282288
/**
283-
* Fires when the submenu is has closed.
289+
* Fires when the submenu has closed.
284290
* @event Drilldown#hide
285291
*/
286292
$elem.trigger('hide.zf.drilldown', [$elem]);
@@ -315,8 +321,10 @@ class Drilldown {
315321
this.$element.unwrap()
316322
.find('.js-drilldown-back, .is-submenu-parent-item').remove()
317323
.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+
});
320328
this.$element.find('a').each(function(){
321329
var $link = $(this);
322330
if($link.data('savedHref')){
@@ -358,4 +366,4 @@ Drilldown.defaults = {
358366
// Window exports
359367
Foundation.plugin(Drilldown, 'Drilldown');
360368

361-
}(jQuery);
369+
}(jQuery);

vendor/assets/js/foundation.dropdown.js.es6

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Dropdown {
7171
getPositionClass() {
7272
var verticalPosition = this.$element[0].className.match(/(top|left|right|bottom)/g);
7373
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);
7575
horizontalPosition = horizontalPosition ? horizontalPosition[1] : '';
7676
var position = horizontalPosition ? horizontalPosition + ' ' + verticalPosition : verticalPosition;
7777
return position;

0 commit comments

Comments
 (0)