Permalink
Browse files

Updated Foundation to 3.2.4

  • Loading branch information...
1 parent 77e6049 commit 6e07dfc9988ea411e28f174bd249ba1c67817cae @ryanwachtl committed Jan 15, 2013
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,3 @@
-@charset "UTF-8";
.typography { /* Requires: normalize.css */ /* Global Reset & Standards ---------------------- */ /* Links ---------------------- */ /* Misc ---------------------- */ /* Reset for strange margins by default on <figure> elements */ /* Base Type Styles Using Modular Scale ---------------------- */ /* Lists ---------------------- */ /* Blockquotes ---------------------- */ /* Print styles. Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/ Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)
*/ }
.typography *, .typography *:before, .typography *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
@@ -34,7 +33,7 @@
.typography h4 { font-size: 23px; }
.typography h5 { font-size: 17px; }
.typography h6 { font-size: 14px; }
-.typography hr { border: solid #dddddd; border-width: 1px 0 0; clear: both; margin: 22px 0 21px; height: 0; }
+.typography hr { border: solid #ddd; border-width: 1px 0 0; clear: both; margin: 22px 0 21px; height: 0; }
.typography .subheader { line-height: 1.3; color: #6f6f6f; font-weight: 300; margin-bottom: 17px; }
.typography em, .typography i { font-style: italic; line-height: inherit; }
.typography strong, .typography b { font-weight: bold; line-height: inherit; }
@@ -54,11 +53,11 @@
.typography ol { margin-left: 20px; }
.typography ol li ul, .typography ol li ol { margin-left: 20px; margin-bottom: 0; }
.typography blockquote, .typography blockquote p { line-height: 1.5; color: #6f6f6f; }
-.typography blockquote { margin: 0 0 17px; padding: 9px 20px 0 19px; border-left: 1px solid #dddddd; }
+.typography blockquote { margin: 0 0 17px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; }
.typography blockquote cite { display: block; font-size: 13px; color: #555555; }
.typography blockquote cite:before { content: "\2014 \0020"; }
.typography blockquote cite a, .typography blockquote cite a:visited { color: #555555; }
-.typography abbr, .typography acronym { text-transform: uppercase; font-size: 90%; color: #222222; border-bottom: 1px solid #dddddd; cursor: help; }
+.typography abbr, .typography acronym { text-transform: uppercase; font-size: 90%; color: #222222; border-bottom: 1px solid #ddd; cursor: help; }
.typography abbr { text-transform: none; }
.typography .print-only { display: none !important; }
@media print { .typography { /* Black prints faster: h5bp.com/s */ /* Don't show links for images, or javascript/internal links */ /* h5bp.com/t */ @page { margin: 0.5cm; }
@@ -68,7 +67,7 @@
.typography a[href]:after { content: " (" attr(href) ")"; }
.typography abbr[title]:after { content: " (" attr(title) ")"; }
.typography .ir a:after, .typography a[href^="javascript:"]:after, .typography a[href^="#"]:after { content: ""; }
- .typography pre, .typography blockquote { border: 1px solid #999999; page-break-inside: avoid; }
+ .typography pre, .typography blockquote { border: 1px solid #999; page-break-inside: avoid; }
.typography thead { display: table-header-group; }
.typography tr, .typography img { page-break-inside: avoid; }
.typography img { max-width: 100% !important; }
No changes.
@@ -30,7 +30,10 @@
if (Modernizr.touch && !window.location.hash) {
$(window).load(function () {
setTimeout(function () {
- window.scrollTo(0, 1);
+ // At load, if user hasn't scrolled more than 20px or so...
+ if( $(window).scrollTop() < 20 ) {
+ window.scrollTo(0, 1);
+ }
}, 0);
});
}
@@ -2,37 +2,46 @@
'use strict';
$.fn.foundationAccordion = function (options) {
- var $accordion = $('.accordion');
- if ($accordion.hasClass('hover') && !Modernizr.touch) {
- $('.accordion li', this).on({
- mouseenter : function () {
- var p = $(this).parent(),
- flyout = $(this).children('.content').first();
+ // DRY up the logic used to determine if the event logic should execute.
+ var hasHover = function(accordion) {
+ return accordion.hasClass('hover') && !Modernizr.touch
+ };
- $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
+ $(document).on('mouseenter', '.accordion li', function () {
+ var p = $(this).parent();
+
+ if (hasHover(p)) {
+ var flyout = $(this).children('.content').first();
+
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active');
flyout.show(0, function () {
flyout.parent('li').addClass('active');
});
}
- });
- } else {
- $('.accordion li', this).on('click.fndtn', function () {
- var li = $(this),
- p = $(this).parent(),
- flyout = $(this).children('.content').first();
-
- if (li.hasClass('active')) {
- p.find('li').removeClass('active').end().find('.content').hide();
- } else {
- $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
- flyout.show(0, function () {
- flyout.parent('li').addClass('active');
- });
+ }
+ );
+
+ $(document).on('click.fndtn', '.accordion li .title', function () {
+ var li = $(this).closest('li'),
+ p = li.parent();
+
+ if(!hasHover(p)) {
+ var flyout = li.children('.content').first();
+
+ if (li.hasClass('active')) {
+ p.find('li').removeClass('active').end().find('.content').hide();
+ } else {
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active');
+ flyout.show(0, function () {
+ flyout.parent('li').addClass('active');
+ });
+ }
}
- });
- }
+ }
+ );
};
-})( jQuery, this );
+})( jQuery, this );
+
@@ -33,14 +33,14 @@
button = $el.closest('.button.dropdown'),
dropdown = $('> ul', button);
- // If the click is registered on an actual link then do not preventDefault which stops the browser from following the link
- if (e.target.nodeName !== "A"){
+ // If the click is registered on an actual link or on button element then do not preventDefault which stops the browser from following the link
+ if (["A", "BUTTON"].indexOf(e.target.nodeName) == -1){
e.preventDefault();
}
// close other dropdowns
setTimeout(function () {
- closeDropdowns(config.dropdownAsToggle ? dropdown : '');
+ closeDropdowns(config.dropdownAsToggle ? '' : dropdown);
dropdown.toggleClass('show-dropdown');
if (config.dropdownAsToggle) {
@@ -100,7 +100,7 @@
$.foundation.customForms.appendCustomMarkup = function ( options ) {
var defaults = {
- disable_class: "js-disable-custom"
+ disable_class: "no-custom"
};
options = $.extend( defaults, options );
@@ -165,7 +165,7 @@
//
// Should we not create a custom list?
//
- if ( $this.hasClass( 'no-custom' ) ) return;
+ if ( $this.hasClass( options.disable_class ) ) return;
//
// Did we not create a custom select element yet?
@@ -186,7 +186,7 @@
//
// Build our custom list.
//
- $customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>"');
+ $customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>');
//
// Grab the selector element
//
@@ -268,11 +268,11 @@
//
// Update the custom <ul> list width property.
//
- $customList.css( 'width', 'inherit' );
+ $customList.css( 'width', 'auto' );
//
// Set the custom select width property.
//
- $customSelect.css( 'width', 'inherit' );
+ $customSelect.css( 'width', 'auto' );
//
// If we're not specifying a predetermined form size.
@@ -416,10 +416,26 @@
if ($associatedElement.attr('type') === 'checkbox') {
event.preventDefault();
$customCheckbox = $(this).find('span.custom.checkbox');
+ //the checkbox might be outside after the label
+ if ($customCheckbox.length == 0) {
+ $customCheckbox = $(this).next('span.custom.checkbox');
+ }
+ //the checkbox might be outside before the label
+ if ($customCheckbox.length == 0) {
+ $customCheckbox = $(this).prev('span.custom.checkbox');
+ }
toggleCheckbox($customCheckbox);
} else if ($associatedElement.attr('type') === 'radio') {
event.preventDefault();
$customRadio = $(this).find('span.custom.radio');
+ //the radio might be outside after the label
+ if ($customRadio.length == 0) {
+ $customRadio = $(this).next('span.custom.radio');
+ }
+ //the radio might be outside before the label
+ if ($customRadio.length == 0) {
+ $customRadio = $(this).prev('span.custom.radio');
+ }
toggleRadio($customRadio);
}
}
@@ -1,5 +1,5 @@
/*
- * jQuery Foundation Joyride Plugin 2.0.2
+ * jQuery Foundation Joyride Plugin 2.0.3
* http://foundation.zurb.com
* Copyright 2012, ZURB
* Free to use under the MIT license.
@@ -12,7 +12,7 @@
'use strict';
var defaults = {
- 'version' : '2.0.1',
+ 'version' : '2.0.3',
'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent
'nubPosition' : 'auto', // override on a per tooltip bases
'scrollSpeed' : 300, // Page scrolling speed in milliseconds
@@ -48,9 +48,9 @@
return this.each(function () {
if ($.isEmptyObject(settings)) {
- settings = $.extend(defaults, opts);
+ settings = $.extend(true, defaults, opts);
- // non configureable settings
+ // non configurable settings
settings.document = window.document;
settings.$document = $(settings.document);
settings.$window = $(window);
@@ -174,7 +174,7 @@
},
create : function (opts) {
- // backwards compatability with data-text attribute
+ // backwards compatibility with data-text attribute
var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
tipClass = opts.$li.attr('class'),
$tip_content = $(methods.tip_template({
@@ -273,7 +273,7 @@
settings.$current_tip = settings.$next_tip;
- // skip non-existant targets
+ // skip non-existent targets
} else if (settings.$li && settings.$target.length < 1) {
methods.show();
@@ -12,24 +12,26 @@
'use strict';
$.fn.foundationMagellan = function(options) {
- var $fixedMagellan = $('[data-magellan-expedition=fixed]'),
+ var $window = $(window),
+ $document = $(document),
+ $fixedMagellan = $('[data-magellan-expedition=fixed]'),
defaults = {
- threshold: ($fixedMagellan.length) ? $fixedMagellan.outerHeight(true) : 25,
- activeClass: 'active'
- },
-
- options = $.extend({}, defaults, options);
-
+ threshold: ($fixedMagellan.length) ? $fixedMagellan.outerHeight(true) : 0,
+ activeClass: 'active'
+ },
+ options = $.extend({}, defaults, options);
+
// Indicate we have arrived at a destination
- $(document).on('magellan.arrival', '[data-magellan-arrival]', function(e) {
- var $expedition = $(this).closest('[data-magellan-expedition]'),
- activeClass = $expedition.attr('data-magellan-active-class') || options.activeClass;
- $(this)
+ $document.on('magellan.arrival', '[data-magellan-arrival]', function(e) {
+ var $destination = $(this),
+ $expedition = $destination.closest('[data-magellan-expedition]'),
+ activeClass = $expedition.attr('data-magellan-active-class') || options.activeClass;
+ $destination
.closest('[data-magellan-expedition]')
.find('[data-magellan-arrival]')
.not(this)
.removeClass(activeClass);
- $(this).addClass(activeClass);
+ $destination.addClass(activeClass);
});
// Set starting point as the current destination
@@ -42,16 +44,15 @@
var $el = $(this);
$el.data("magellan-fixed-position","");
$el.data("magellan-top-offset", "");
- });
+ })
+ .trigger('magellan.update-position');
- $fixedMagellan.trigger('magellan.update-position');
-
- $(window).on('resize.magellan', function() {
+ $window.on('resize.magellan', function() {
$fixedMagellan.trigger('magellan.update-position');
});
- $(window).on('scroll.magellan', function() {
- var windowScrollTop = $(window).scrollTop();
+ $window.on('scroll.magellan', function() {
+ var windowScrollTop = $window.scrollTop();
$fixedMagellan.each(function() {
var $expedition = $(this);
if ($expedition.data("magellan-top-offset") === "") {
@@ -70,15 +71,21 @@
});
// Determine when a destination has been reached, ah0y!
- $(window).on('scroll.magellan', function(e){
- var windowScrollTop = $(window).scrollTop();
+ var $lastDestination = $('[data-magellan-destination]:last');
+ $window.on('scroll.magellan', function(e){
+ var windowScrollTop = $window.scrollTop(),
+ scrolltopPlusHeight = windowScrollTop+$window.outerHeight(true),
+ lastDestinationTop = Math.ceil($lastDestination.offset().top);
$('[data-magellan-destination]').each(function(){
var $destination = $(this),
destination_name = $destination.attr('data-magellan-destination'),
topOffset = $destination.offset().top - windowScrollTop;
if (topOffset <= options.threshold) {
- $('[data-magellan-arrival=' + destination_name + ']')
- .trigger('magellan.arrival');
+ $('[data-magellan-arrival=' + destination_name + ']').trigger('magellan.arrival');
+ }
+ // In large screens we may hit the bottom of the page and dont reach the top of the last magellan-destination, so lets force it
+ if (scrolltopPlusHeight >= $document.outerHeight(true) && lastDestinationTop > windowScrollTop && lastDestinationTop < scrolltopPlusHeight) {
+ $('[data-magellan-arrival]:last').trigger('magellan.arrival');
}
});
});
Oops, something went wrong.

0 comments on commit 6e07dfc

Please sign in to comment.