Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
updated to 6.0.6+develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalk committed Dec 16, 2015
1 parent e800ae9 commit ea45da0
Show file tree
Hide file tree
Showing 28 changed files with 641 additions and 510 deletions.
9 changes: 9 additions & 0 deletions vendor/assets/javascripts/foundation/foundation.abide.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@
return true;
}
break;
case 'password':
if ($el.attr('required') && !$el.val()) {
// requirement check does not pass
return false;
} else {
return true;
}
break;
case 'checkbox':
if ($el.attr('required') && !$el.is(':checked')) {
return false;
Expand Down Expand Up @@ -222,6 +230,7 @@
Abide.prototype.validateInput = function($el, $form) {
var self = this,
textInput = $form.find('input[type="text"]'),
passwordInput = $form.find('input[type="password"]'),
checkInput = $form.find('input[type="checkbox"]'),
label,
radioGroupName;
Expand Down
17 changes: 10 additions & 7 deletions vendor/assets/javascripts/foundation/foundation.accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
Accordion.prototype._init = function() {
this.$element.attr('role', 'tablist');
this.$tabs = this.$element.children('li');
if (this.$tabs.length == 0) {
this.$tabs = this.$element.children('[data-accordion-item]');
}
this.$tabs.each(function(idx, el){

var $el = $(el),
Expand Down Expand Up @@ -158,13 +161,13 @@
.addBack()
.parent().addClass('is-active');

Foundation.Move(_this.options.slideSpeed, $target, function(){
// Foundation.Move(_this.options.slideSpeed, $target, function(){
$target.slideDown(_this.options.slideSpeed);
});
// });

if(!firstTime){
Foundation._reflow(this.$element.attr('data-accordion'));
}
// if(!firstTime){
// Foundation._reflow(this.$element.attr('data-accordion'));
// }
$('#' + $target.attr('aria-labelledby')).attr({
'aria-expanded': true,
'aria-selected': true
Expand All @@ -191,9 +194,9 @@
return;
}

Foundation.Move(this.options.slideSpeed, $target, function(){
// Foundation.Move(this.options.slideSpeed, $target, function(){
$target.slideUp(_this.options.slideSpeed);
});
// });

$target.attr('aria-hidden', true)
.parent().removeClass('is-active');
Expand Down
12 changes: 7 additions & 5 deletions vendor/assets/javascripts/foundation/foundation.accordionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@
* @param {jQuery} $target - the submenu to toggle
*/
AccordionMenu.prototype.toggle = function($target){
if (!$target.is(':hidden')) {
this.up($target);
}
else {
this.down($target);
if(!$target.is(':animated')) {
if (!$target.is(':hidden')) {
this.up($target);
}
else {
this.down($target);
}
}
};
/**
Expand Down
6 changes: 3 additions & 3 deletions vendor/assets/javascripts/foundation/foundation.core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!function($) {
"use strict";

var FOUNDATION_VERSION = '6.0.5';
var FOUNDATION_VERSION = '6.0.6';

// Global Foundation object
// This is attached to the window, or used as a module for AMD/Browserify
Expand Down Expand Up @@ -161,14 +161,14 @@ var Foundation = {
var plugin = _this._plugins[name];

// Localize the search to all elements inside elem, as well as elem itself, unless elem === document
var $elem = $(elem).find('[data-'+name+']').addBack('*');
var $elem = $(elem).find('[data-'+name+']').addBack('[data-'+name+']');

// For each plugin found, initialize it
$elem.each(function() {
var $el = $(this),
opts = {};
// Don't double-dip on plugins
if ($el.attr('zf-plugin')) {
if ($el.data('zf-plugin')) {
console.warn("Tried to initialize "+name+" on an element that already has a Foundation plugin.");
return;
}
Expand Down
34 changes: 28 additions & 6 deletions vendor/assets/javascripts/foundation/foundation.dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
* @example false
*/
hover: false,
/**
* Don't close dropdown when hovering over dropdown pane
* @option
* @example true
*/
hoverPane: false,
/**
* Number of pixels between the dropdown pane and the triggering element on open.
* @option
Expand Down Expand Up @@ -199,21 +205,34 @@
this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')
.on('mouseenter.zf.dropdown', function(){
clearTimeout(_this.timeout);
_this.timeOut = setTimeout(function(){
_this.timeout = setTimeout(function(){
_this.open();
_this.$anchor.data('hover', true);
}, _this.options.hoverDelay);
}).on('mouseleave.zf.dropdown', function(){
clearTimeout(_this.timeout);
_this.timeOut = setTimeout(function(){
_this.timeout = setTimeout(function(){
_this.close();
_this.$anchor.data('hover', false);
}, _this.options.hoverDelay);
});
if(this.options.hoverPane){
this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')
.on('mouseenter.zf.dropdown', function(){
clearTimeout(_this.timeout);
}).on('mouseleave.zf.dropdown', function(){
clearTimeout(_this.timeout);
_this.timeout = setTimeout(function(){
_this.close();
_this.$anchor.data('hover', false);
}, _this.options.hoverDelay);
});
}
}
this.$anchor.add(this.$element).on('keydown.zf.dropdown', function(e) {

var visibleFocusableElements = Foundation.Keyboard.findFocusable(_this.$element);
var $target = $(this),
visibleFocusableElements = Foundation.Keyboard.findFocusable(_this.$element);

Foundation.Keyboard.handleKey(e, _this, {
tab_forward: function() {
Expand All @@ -237,8 +256,11 @@
}
},
open: function() {
_this.open();
_this.$element.attr('tabindex', -1).focus();
if ($target.is(_this.$anchor)) {
_this.open();
_this.$element.attr('tabindex', -1).focus();
e.preventDefault();
}
},
close: function() {
_this.close();
Expand Down Expand Up @@ -266,7 +288,7 @@
this._setPosition();
this.$element.addClass('is-open')
.attr({'aria-hidden': false});

if(this.options.autoFocus){
var $focusable = Foundation.Keyboard.findFocusable(this.$element);
if($focusable.length){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
html = document.documentElement;

this.points = [];
this.winHeight = Math.round(Math.max(window.innerHeight, document.body.clientHeight));
this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));

this.$targets.each(function(){
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/foundation/foundation.orbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Creates a new instance of an orbit carousel.
* @class
* @param {jQuery} element - jQuery object to make into an accordion menu.
* @param {jQuery} element - jQuery object to make into an Orbit Carousel.
* @param {Object} options - Overrides to the default plugin settings.
*/
function Orbit(element, options){
Expand Down
5 changes: 3 additions & 2 deletions vendor/assets/javascripts/foundation/foundation.slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
lOrT = vert ? 'top' : 'left',
halfOfHandle = $hndl[0].getBoundingClientRect()[hOrW] / 2,
elemDim = this.$element[0].getBoundingClientRect()[hOrW],
pctOfBar = percent(location, this.options.end).toFixed(this.options.decimal),
pctOfBar = percent(location, this.options.end).toFixed(2),
pxToMove = (elemDim - halfOfHandle) * pctOfBar,
movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal),
location = location > 0 ? parseFloat(location.toFixed(this.options.decimal)) : 0,
Expand All @@ -241,7 +241,8 @@
css['min-' + hOrW] = dim;
if(cb && typeof cb === 'function'){ cb(); }
}else{
location = (location < 100 ? location : 100) - (parseFloat(this.$handle[0].style.left) || this.options.end - location);
var handleLeft = parseFloat(this.$handle[0].style.left);
location = (location < 100 ? location : 100) - (!isNaN(handleLeft) ? handleLeft : this.options.end - location);
css['min-' + hOrW] = location + '%';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@ function parseStyleToObject(str) {
return styleObject;
}

}(jQuery, Foundation)
}(jQuery, Foundation);
Loading

0 comments on commit ea45da0

Please sign in to comment.