foundation
Advanced tools
Comparing version 4.1.6 to 4.2.1-1
@@ -34,3 +34,3 @@ # Foundation | ||
cd demo1 | ||
echo -e 'source :rubygems\n | ||
echo -e 'source "https://rubygems.org"\n | ||
gem "zurb-foundation", :path => "/path/to/foundation/repo"\n | ||
@@ -52,4 +52,5 @@ gem "compass"\n' > Gemfile | ||
3. Test your changes to the best of your ability. We've provided a test/ folder, feel free to add to it as necessary. | ||
4. Commit your changes (`git commit -am 'Added some feature'`) | ||
5. Push to the branch (`git push origin my-new-feature`) | ||
6. Create new Pull Request | ||
4. Update the documentation to reflect your changes if they add or changes current functionality. Run `bundle && bundle exec foreman start` to compile to documentation. Make sure you are in the docs folder before you do this. | ||
5. Commit your changes (`git commit -am 'Added some feature'`) | ||
6. Push to the branch (`git push origin my-new-feature`) | ||
7. Create new Pull Request |
@@ -0,1 +1,36 @@ | ||
### 4.2.1- May 31, 2013 | ||
* Add missing `$experimental` Sass variable | ||
* Bug fixes for top bar in mobile view | ||
* Retina is now a default named media query for Interchange | ||
* Removes incompatible Zepto function used in custom forms | ||
You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.2.0...v4.2.1). | ||
### 4.2- May 30, 2013 | ||
* Added new Interchange Plugin for handling responsive images. | ||
* Made a variable for the "sticky" class on the top-bar. | ||
* Changed media query variables to pixels for better consistency between font sizes. | ||
* Fixed deep linking for foundation.section.js. | ||
* Added data-options support to top-bar, you can now include "is_hover: false" to make it clickable. | ||
* Each dropdown section of the top-bar for mobile now takes on its natural height rather than looking for the tallest and setting them all to that. | ||
* Added data-options support for tool-tips. | ||
* Added .large-uncentered for when you only want centered on small screens. | ||
* Made block-grid spacing more like the normal grid. | ||
* Fixed confusing comments in visibility classes SCSS file. | ||
* Added AJAX support to Reveal. | ||
* Added cursor variables. | ||
* Fixed various typos in the documentation. | ||
* Updated CONTRIBUTOR.md to include how to run the docs locally. | ||
* Added Codekit instructions to documentation. | ||
* Changed to a better method test for Zepto. | ||
* Added hover support for dropdowns data-options by including "is_hover: true" to the options. | ||
* Added the ability to use deep-linking inside nested Sections. | ||
* Added the ability to use HTML in the data-caption for Clearing. | ||
* Fixes problem with embedded Youtube videos inside of Reveal. | ||
* Orbit now has pause/resume on hover/mousout capability. | ||
* Fixed Section vertical tabs on mobile. | ||
* Lots of small bug fixes and improvements for many of the JS components. | ||
You can compare the commits [here](https://github.com/zurb/foundation/compare/v4.1.6...v4.2.0). | ||
### 4.1.6- May 6, 2013 | ||
@@ -270,2 +305,2 @@ * Improved performance for custom select boxes. | ||
### **3.0**- June 30, 2012 | ||
Initial launch of Foundation 3, deprecating Foundation 2.2.1. Major enhancements include Sass/SCSS development, new grid system with box-sizing: border-box, new form styles, new UI elements, retooled download and install options, new docs, new marketing site. | ||
Initial launch of Foundation 3, deprecating Foundation 2.2.1. Major enhancements include Sass/SCSS development, new grid system with box-sizing: border-box, new form styles, new UI elements, retooled download and install options, new docs, new marketing site. |
@@ -48,4 +48,6 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
$(this.scope).off('.fndtn.alerts'); | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -391,3 +391,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
container | ||
.text(caption) | ||
.html(caption) | ||
.show(); | ||
@@ -394,0 +394,0 @@ } else { |
@@ -9,6 +9,7 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.1.3', | ||
version : '4.2.0', | ||
settings : { | ||
activeClass: 'open', | ||
is_hover: false, | ||
opened: function(){}, | ||
@@ -20,3 +21,3 @@ closed: function(){} | ||
this.scope = scope || this.scope; | ||
Foundation.inherit(this, 'throttle scrollLeft'); | ||
Foundation.inherit(this, 'throttle scrollLeft data_options'); | ||
@@ -44,5 +45,16 @@ if (typeof method === 'object') { | ||
.on('click.fndtn.dropdown', '[data-dropdown]', function (e) { | ||
e.preventDefault(); | ||
self.toggle($(this)); | ||
var settings = $.extend({}, self.settings, self.data_options($(this))); | ||
e.preventDefault(); | ||
if (!settings.is_hover) self.toggle($(this)); | ||
}) | ||
.on('mouseenter', '[data-dropdown]', function (e) { | ||
var settings = $.extend({}, self.settings, self.data_options($(this))); | ||
if (settings.is_hover) self.toggle($(this)); | ||
}) | ||
.on('mouseleave', '[data-dropdown-content]', function (e) { | ||
var target = $('[data-dropdown="' + $(this).attr('id') + '"]'), | ||
settings = $.extend({}, self.settings, self.data_options(target)); | ||
if (settings.is_hover) self.close.call(self, $(this)); | ||
}) | ||
.on('opened.fndtn.dropdown', '[data-dropdown-content]', this.settings.opened) | ||
@@ -99,2 +111,3 @@ .on('closed.fndtn.dropdown', '[data-dropdown-content]', this.settings.closed); | ||
} else { | ||
this.close.call(this, $('[data-dropdown-content]')) | ||
this.open.call(this, dropdown, target); | ||
@@ -114,4 +127,5 @@ } | ||
css : function (dropdown, target) { | ||
var offset_parent = dropdown.offsetParent(); | ||
// temporary workaround until 4.2 | ||
if (/body/i.test(dropdown.offsetParent()[0].nodeName)) { | ||
if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) { | ||
var position = target.offset(); | ||
@@ -135,2 +149,5 @@ position.top -= dropdown.offsetParent().offset().top; | ||
var left = position.left; | ||
if (dropdown.hasClass('right')) { | ||
dropdown.removeClass('right'); | ||
} | ||
} else { | ||
@@ -163,4 +180,6 @@ if (!dropdown.hasClass('right')) { | ||
this.settings.init = false; | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -7,3 +7,3 @@ (function ($, window, document, undefined) { | ||
version: '4.1.6', | ||
version: '4.2.1', | ||
@@ -37,6 +37,2 @@ cache: {}, | ||
assemble: function () { | ||
$('form.custom input[type="radio"]', $(this.scope)).not('[data-customforms="disabled"]') | ||
.each(this.append_custom_markup); | ||
$('form.custom input[type="checkbox"]', $(this.scope)).not('[data-customforms="disabled"]') | ||
.each(this.append_custom_markup); | ||
$('form.custom select', $(this.scope)) | ||
@@ -52,42 +48,5 @@ .not('[data-customforms="disabled"]') | ||
$(this.scope) | ||
.on('click.fndtn.forms', 'form.custom span.custom.checkbox', function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
self.toggle_checkbox($(this)); | ||
}) | ||
.on('click.fndtn.forms', 'form.custom span.custom.radio', function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
self.toggle_radio($(this)); | ||
}) | ||
.on('change.fndtn.forms', 'form.custom select:not([data-customforms="disabled"])', function (e, force_refresh) { | ||
self.refresh_custom_select($(this), force_refresh); | ||
}) | ||
.on('click.fndtn.forms', 'form.custom label', function (e) { | ||
if ($(e.target).is('label')) { | ||
var $associatedElement = $('#' + self.escape($(this).attr('for')) + ':not([data-customforms="disabled"])'), | ||
$customCheckbox, | ||
$customRadio; | ||
if ($associatedElement.length !== 0) { | ||
if ($associatedElement.attr('type') === 'checkbox') { | ||
e.preventDefault(); | ||
$customCheckbox = $(this).find('span.custom.checkbox'); | ||
//the checkbox might be outside after the label or inside of another element | ||
if ($customCheckbox.length == 0) { | ||
$customCheckbox = $associatedElement.add(this).siblings('span.custom.checkbox').first(); | ||
} | ||
self.toggle_checkbox($customCheckbox); | ||
} else if ($associatedElement.attr('type') === 'radio') { | ||
e.preventDefault(); | ||
$customRadio = $(this).find('span.custom.radio'); | ||
//the radio might be outside after the label or inside of another element | ||
if ($customRadio.length == 0) { | ||
$customRadio = $associatedElement.add(this).siblings('span.custom.radio').first(); | ||
} | ||
self.toggle_radio($customRadio); | ||
} | ||
} | ||
} | ||
}) | ||
.on('click.fndtn.forms', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (e) { | ||
@@ -162,3 +121,3 @@ var $this = $(this), | ||
} | ||
if (e.which === 27) { | ||
@@ -203,3 +162,3 @@ dropdown.removeClass('open'); | ||
go_to: function (dropdown, char) { | ||
go_to: function (dropdown, character) { | ||
var lis = dropdown.find('li'), | ||
@@ -211,3 +170,3 @@ count = lis.length; | ||
var first_letter = lis.eq(i).text().charAt(0).toLowerCase(); | ||
if (first_letter === String.fromCharCode(char).toLowerCase()) return lis.eq(i); | ||
if (first_letter === String.fromCharCode(character).toLowerCase()) return lis.eq(i); | ||
} | ||
@@ -232,19 +191,2 @@ } | ||
append_custom_markup: function (idx, sel) { | ||
var $this = $(sel), | ||
type = $this.attr('type'), | ||
$span = $this.next('span.custom.' + type); | ||
if (!$this.parent().hasClass('switch')) { | ||
$this.addClass('hidden-field'); | ||
} | ||
if ($span.length === 0) { | ||
$span = $('<span class="custom ' + type + '"></span>').insertAfter($this); | ||
} | ||
$span.toggleClass('checked', $this.is(':checked')); | ||
$span.toggleClass('disabled', $this.is(':disabled')); | ||
}, | ||
append_custom_select: function (idx, sel) { | ||
@@ -279,3 +221,4 @@ var self = Foundation.libs.forms, | ||
liHtml = $options.map(function () { | ||
return "<li>" + $(this).html() + "</li>"; | ||
var copyClasses = $(this).attr('class') ? $(this).attr('class') : ''; | ||
return "<li class='" + copyClasses + "'>" + $(this).html() + "</li>"; | ||
}).get().join(''); | ||
@@ -402,33 +345,2 @@ | ||
toggle_checkbox: function ($element) { | ||
var $input = $element.prev(), | ||
input = $input[0]; | ||
if (false === $input.is(':disabled')) { | ||
input.checked = ((input.checked) ? false : true); | ||
$element.toggleClass('checked'); | ||
$input.trigger('change'); | ||
} | ||
}, | ||
toggle_radio: function ($element) { | ||
var $input = $element.prev(), | ||
$form = $input.closest('form.custom'), | ||
input = $input[0]; | ||
if (false === $input.is(':disabled')) { | ||
$form.find('input[type="radio"][name="' + this.escape($input.attr('name')) + '"]') | ||
.next().not($element).removeClass('checked'); | ||
if (!$element.hasClass('checked')) { | ||
$element.toggleClass('checked'); | ||
} | ||
input.checked = $element.hasClass('checked'); | ||
$input.trigger('change'); | ||
} | ||
}, | ||
escape: function (text) { | ||
@@ -457,3 +369,4 @@ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||
// Set all hidden parent elements, including this element. | ||
_self.hidden = $child.parents().andSelf().filter(":hidden"); | ||
_self.hidden = $child.parents(); | ||
_self.hidden = _self.hidden.add($child).filter(":hidden"); | ||
@@ -512,3 +425,5 @@ // Loop through all hidden elements. | ||
$(this.scope).off('.fndtn.forms'); | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
@@ -524,2 +439,2 @@ | ||
}; | ||
}(Foundation.zj, this, this.document)); | ||
}(Foundation.zj, this, this.document)); |
@@ -9,3 +9,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.1.2', | ||
version : '4.2.0', | ||
@@ -45,3 +45,4 @@ defaults : { | ||
exposeCover: '<div class="joyride-expose-cover"></div>' | ||
} | ||
}, | ||
exposeAddClass : '' // One or more space-separated class names to be added to exposed element | ||
}, | ||
@@ -570,2 +571,3 @@ | ||
origCSS, | ||
origClasses, | ||
randId = 'expose-'+Math.floor(Math.random()*10000); | ||
@@ -603,2 +605,4 @@ | ||
}; | ||
origClasses = el.attr('class') == null ? '' : el.attr('class'); | ||
@@ -612,2 +616,4 @@ el.css('z-index',parseInt(expose.css('z-index'))+1); | ||
el.data('expose-css',origCSS); | ||
el.data('orig-class', origClasses); | ||
el.attr('class', origClasses + ' ' + this.settings.exposeAddClass); | ||
@@ -634,2 +640,3 @@ exposeCover.css({ | ||
origCSS, | ||
origClasses, | ||
clearAll = false; | ||
@@ -680,2 +687,6 @@ | ||
} | ||
origClasses = el.data('orig-class'); | ||
el.attr('class', origClasses); | ||
el.removeData('orig-classes'); | ||
@@ -836,4 +847,6 @@ el.removeData('expose'); | ||
this.settings = {}; | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -32,2 +32,44 @@ /* | ||
/* | ||
matchMedia() polyfill - Test a CSS media | ||
type/query in JS. Authors & copyright (c) 2012: | ||
Scott Jehl, Paul Irish, Nicholas Zakas. | ||
Dual MIT/BSD license | ||
https://github.com/paulirish/matchMedia.js | ||
*/ | ||
window.matchMedia = window.matchMedia || (function( doc, undefined ) { | ||
"use strict"; | ||
var bool, | ||
docElem = doc.documentElement, | ||
refNode = docElem.firstElementChild || docElem.firstChild, | ||
// fakeBody required for <FF4 when executed in <head> | ||
fakeBody = doc.createElement( "body" ), | ||
div = doc.createElement( "div" ); | ||
div.id = "mq-test-1"; | ||
div.style.cssText = "position:absolute;top:-100em"; | ||
fakeBody.style.background = "none"; | ||
fakeBody.appendChild(div); | ||
return function(q){ | ||
div.innerHTML = "­<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>"; | ||
docElem.insertBefore( fakeBody, refNode ); | ||
bool = div.offsetWidth === 42; | ||
docElem.removeChild( fakeBody ); | ||
return { | ||
matches: bool, | ||
media: q | ||
}; | ||
}; | ||
}( document )); | ||
// add dusty browser stuff | ||
@@ -128,5 +170,4 @@ if (!Array.prototype.filter) { | ||
version : '4.1.5', | ||
version : '4.2.0', | ||
// global Foundation cache object | ||
cache : {}, | ||
@@ -150,3 +191,3 @@ | ||
if (libraries && typeof libraries === 'string') { | ||
if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) { | ||
if (/off/i.test(libraries)) return this.off(); | ||
@@ -162,2 +203,4 @@ | ||
} else { | ||
if (/reflow/i.test(libraries)) args[1] = 'reflow'; | ||
for (var lib in this.libs) { | ||
@@ -196,2 +239,5 @@ responses.push(this.init_lib(lib, args)); | ||
} | ||
else { | ||
return function () {}; | ||
} | ||
}.bind(this), lib); | ||
@@ -232,3 +278,3 @@ }, | ||
if (!length) { | ||
length = Math.floor(Math.random() * chars.length); | ||
length = Math.floor(Math.random() * chars.length); | ||
} | ||
@@ -238,3 +284,3 @@ | ||
for (var i = 0; i < length; i++) { | ||
str += chars[Math.floor(Math.random() * chars.length)]; | ||
str += chars[Math.floor(Math.random() * chars.length)]; | ||
} | ||
@@ -391,5 +437,5 @@ return str; | ||
zj : function () { | ||
try { | ||
if (typeof Zepto !== 'undefined') { | ||
return Zepto; | ||
} catch (e) { | ||
} else { | ||
return jQuery; | ||
@@ -396,0 +442,0 @@ } |
@@ -9,3 +9,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.0.0', | ||
version : '4.2.0', | ||
@@ -58,3 +58,3 @@ settings : { | ||
// $el.data("magellan-fixed-position",""); | ||
//$el.data("magellan-top-offset", ""); | ||
// $el.data("magellan-top-offset", ""); | ||
}) | ||
@@ -130,4 +130,6 @@ .trigger('update-position'); | ||
$(this.scope).off('.fndtn.magellan'); | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -9,6 +9,8 @@ ;(function ($, window, document, undefined) { | ||
version: '4.1.0', | ||
version: '4.2.0', | ||
settings: { | ||
timer_speed: 10000, | ||
pause_on_hover: true, | ||
resume_on_mouseout: false, | ||
animation_speed: 500, | ||
@@ -43,2 +45,7 @@ bullets: true, | ||
if ($(scope).is('[data-orbit]')) { | ||
var scoped_self = $.extend(true, {}, self); | ||
scoped_self._init(idx, el); | ||
} | ||
$('[data-orbit]', scope).each(function(idx, el) { | ||
@@ -124,3 +131,3 @@ var scoped_self = $.extend(true, {}, self); | ||
// Make the first "real" slide active | ||
$slides_container.css('marginLeft', '-100%'); | ||
$slides_container.css(Foundation.rtl ? 'marginRight' : 'marginLeft', '-100%'); | ||
$slides.first().addClass(self.settings.active_slide_class); | ||
@@ -167,2 +174,12 @@ | ||
$container | ||
.on('mouseenter.fndtn.orbit', function(e) { | ||
if (self.settings.pause_on_hover) { | ||
self._stop_timer($slides_container); | ||
} | ||
}) | ||
.on('mouseleave.fndtn.orbit', function(e) { | ||
if (self.settings.resume_on_mouseout) { | ||
self._start_timer($slides_container); | ||
} | ||
}) | ||
.on('orbit:after-slide-change.fndtn.orbit', function(e, orbit) { | ||
@@ -169,0 +186,0 @@ var $slide_number = $container.find('.' + self.settings.slide_number_class); |
@@ -9,3 +9,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.1.3', | ||
version : '4.2.0', | ||
@@ -18,2 +18,3 @@ locked : false, | ||
closeOnBackgroundClick: true, | ||
closeOnEsc: true, | ||
dismissModalClass: 'close-reveal-modal', | ||
@@ -41,3 +42,2 @@ bgClass: 'reveal-modal-bg', | ||
init : function (scope, method, options) { | ||
this.scope = scope || this.scope; | ||
Foundation.inherit(this, 'data_options delay'); | ||
@@ -67,5 +67,16 @@ | ||
e.preventDefault(); | ||
if (!self.locked) { | ||
var element = $(this), | ||
ajax = element.data('reveal-ajax'); | ||
self.locked = true; | ||
self.open.call(self, $(this)); | ||
if (typeof ajax === 'undefined') { | ||
self.open.call(self, element); | ||
} else { | ||
var url = ajax === true ? element.attr('href') : ajax; | ||
self.open.call(self, element, {url: url}); | ||
} | ||
} | ||
@@ -92,8 +103,22 @@ }) | ||
$( 'body' ).bind( 'keyup.reveal', function ( event ) { | ||
var open_modal = $('.reveal-modal.open'), | ||
settings = $.extend({}, self.settings, self.data_options(open_modal)); | ||
if ( event.which === 27 && settings.closeOnEsc) { // 27 is the keycode for the Escape key | ||
open_modal.foundation('reveal', 'close'); | ||
} | ||
}); | ||
return true; | ||
}, | ||
open : function (target) { | ||
open : function (target, ajax_settings) { | ||
if (target) { | ||
var modal = $('#' + target.data('reveal-id')); | ||
if (typeof target.selector !== 'undefined') { | ||
var modal = $('#' + target.data('reveal-id')); | ||
} else { | ||
var modal = $(this.scope); | ||
ajax_settings = target; | ||
} | ||
} else { | ||
@@ -116,4 +141,26 @@ var modal = $(this.scope); | ||
} | ||
this.hide(open_modal, this.settings.css.close); | ||
this.show(modal, this.settings.css.open); | ||
if (typeof ajax_settings === 'undefined' || !ajax_settings.url) { | ||
this.hide(open_modal, this.settings.css.close); | ||
this.show(modal, this.settings.css.open); | ||
} else { | ||
var self = this, | ||
old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null; | ||
$.extend(ajax_settings, { | ||
success: function (data, textStatus, jqXHR) { | ||
if ( $.isFunction(old_success) ) { | ||
old_success(data, textStatus, jqXHR); | ||
} | ||
modal.html(data); | ||
$(modal).foundation('section', 'reflow'); | ||
self.hide(open_modal, self.settings.css.close); | ||
self.show(modal, self.settings.css.open); | ||
} | ||
}); | ||
$.ajax(ajax_settings); | ||
} | ||
} | ||
@@ -124,3 +171,3 @@ }, | ||
var modal = modal || $(this.scope), | ||
var modal = modal && modal.length ? modal : $(this.scope), | ||
open_modals = $('.reveal-modal.open'); | ||
@@ -255,3 +302,3 @@ | ||
iframe.attr('src', 'about:blank'); | ||
video.fadeOut(100).hide(); | ||
video.hide(); | ||
} | ||
@@ -268,4 +315,8 @@ }, | ||
iframe[0].src = iframe.attr('data-src'); | ||
} else { | ||
var src = iframe[0].src; | ||
iframe[0].src = undefined; | ||
iframe[0].src = src; | ||
} | ||
video.show().fadeIn(100); | ||
video.show(); | ||
} | ||
@@ -284,4 +335,6 @@ }, | ||
$(this.scope).off('.fndtn.reveal'); | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -9,3 +9,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.1.3', | ||
version : '4.2.0', | ||
@@ -48,6 +48,8 @@ settings : { | ||
var $this = $(this), | ||
section = $this.closest(self.settings.section_selector); | ||
section = $this.closest(self.settings.region_selector); | ||
self.toggle_active.call(this, e, self); | ||
self.reflow(); | ||
if (section.children(self.settings.content_selector).length > 0) { | ||
self.toggle_active.call(this, e, self); | ||
self.reflow(); | ||
} | ||
}); | ||
@@ -202,3 +204,3 @@ | ||
if ( (self.is_horizontal_nav($this) && !self.small($this)) | ||
|| self.is_vertical_tabs($this)) { | ||
|| self.is_vertical_tabs($this) && !self.small($this)) { | ||
self.position_content($this); | ||
@@ -235,3 +237,2 @@ } else { | ||
self = this; | ||
sections.each(function () { | ||
@@ -246,8 +247,17 @@ var section = $(this), | ||
.removeClass('active'); | ||
regions | ||
.map(function () { | ||
return $(this).children('.content[data-slug="' + hash + '"], [data-section-content][data-slug="' + hash + '"]'); | ||
}) | ||
.parent() | ||
.addClass('active'); | ||
var hash_regions = regions.map(function () { | ||
var content = $(self.settings.content_selector, this), | ||
content_slug = content.data('slug'); | ||
if (new RegExp(content_slug, 'i').test(hash)) | ||
return content; | ||
}); | ||
var count = hash_regions.length; | ||
for (var i = count - 1; i >= 0; i--) { | ||
$(hash_regions[i]).parent().addClass('active'); | ||
} | ||
} | ||
@@ -318,2 +328,3 @@ }); | ||
content_width = self.outerWidth(section) - title_width; | ||
if (content_width < content_min_width) { | ||
@@ -344,5 +355,2 @@ content_min_width = content_width; | ||
// Adjust the outer section container width to match | ||
// the width of the title and content | ||
section.css('maxWidth', title_width + content_min_width); | ||
} else { | ||
@@ -366,5 +374,5 @@ regions.each(function () { | ||
if (typeof Zepto === 'function') { | ||
section.height(this.outerHeight(titles.first())); | ||
section.height(this.outerHeight($(titles[0]))); | ||
} else { | ||
section.height(this.outerHeight(titles.first()) - 2); | ||
section.height(this.outerHeight($(titles[0])) - 2); | ||
} | ||
@@ -394,2 +402,3 @@ } | ||
var settings = $.extend({}, this.settings, this.data_options(el)); | ||
if (this.is_horizontal_tabs(el)) { | ||
@@ -396,0 +405,0 @@ return false; |
@@ -9,3 +9,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.1.3', | ||
version : '4.2.0', | ||
@@ -17,2 +17,3 @@ settings : { | ||
appendTo: 'body', | ||
'disable-for-touch': false, | ||
tipTemplate : function (selector, content) { | ||
@@ -28,7 +29,9 @@ return '<span data-selector="' + selector + '" class="' | ||
init : function (scope, method, options) { | ||
Foundation.inherit(this, 'data_options'); | ||
var self = this; | ||
this.scope = scope || this.scope; | ||
if (typeof method === 'object') { | ||
$.extend(true, this.settings, method); | ||
} else if (typeof options !== 'undefined') { | ||
$.extend(true, this.settings, options); | ||
} | ||
@@ -41,5 +44,8 @@ | ||
'[data-tooltip]', function (e) { | ||
e.preventDefault(); | ||
$(self.settings.tooltipClass).hide(); | ||
self.showOrCreateTip($(this)); | ||
var settings = $.extend({}, self.settings, self.data_options($(this))); | ||
if (!settings['disable-for-touch']) { | ||
e.preventDefault(); | ||
$(settings.tooltipClass).hide(); | ||
self.showOrCreateTip($(this)); | ||
} | ||
}) | ||
@@ -57,3 +63,3 @@ .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip', | ||
if (e.type === 'mouseover' || e.type === 'mouseenter') { | ||
if (/enter|over/i.test(e.type)) { | ||
self.showOrCreateTip($this); | ||
@@ -88,3 +94,3 @@ } else if (e.type === 'mouseout' || e.type === 'mouseleave') { | ||
if (selector) { | ||
tip = $('span[data-selector=' + selector + ']' + this.settings.tooltipClass); | ||
tip = $('span[data-selector="' + selector + '"]' + this.settings.tooltipClass); | ||
} | ||
@@ -204,4 +210,6 @@ | ||
}).remove(); | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -9,3 +9,3 @@ /*jslint unparam: true, browser: true, indent: 2 */ | ||
version : '4.1.2', | ||
version : '4.2.0', | ||
@@ -17,2 +17,4 @@ settings : { | ||
back_text: 'Back', | ||
is_hover: true, | ||
scrolltop : true, // jump to top when sticky nav menu toggle is clicked | ||
init : false | ||
@@ -22,2 +24,3 @@ }, | ||
init : function (section, method, options) { | ||
Foundation.inherit(this, 'data_options'); | ||
var self = this; | ||
@@ -27,2 +30,4 @@ | ||
$.extend(true, this.settings, method); | ||
} else if (typeof options !== 'undefined') { | ||
$.extend(true, this.settings, options); | ||
} | ||
@@ -32,3 +37,4 @@ | ||
$('.top-bar').each(function () { | ||
$('.top-bar, [data-topbar]').each(function () { | ||
$.extend(true, self.settings, self.data_options($(this))); | ||
self.settings.$w = $(window); | ||
@@ -38,4 +44,2 @@ self.settings.$topbar = $(this); | ||
self.settings.$titlebar = self.settings.$topbar.children('ul').first(); | ||
self.settings.$topbar.data('index', 0); | ||
@@ -67,20 +71,13 @@ | ||
var self = this; | ||
var offst = this.outerHeight($('.top-bar')); | ||
var offst = this.outerHeight($('.top-bar, [data-topbar]')); | ||
$(this.scope) | ||
.on('click.fndtn.topbar', '.top-bar .toggle-topbar', function (e) { | ||
var topbar = $(this).closest('.top-bar'), | ||
.off('.fndtn.topbar') | ||
.on('click.fndtn.topbar', '.top-bar .toggle-topbar, [data-topbar] .toggle-topbar', function (e) { | ||
var topbar = $(this).closest('.top-bar, [data-topbar]'), | ||
section = topbar.find('section, .section'), | ||
titlebar = topbar.children('ul').first(); | ||
if (!topbar.data('height')) self.largestUL(); | ||
e.preventDefault(); | ||
if (self.breakpoint()) { | ||
topbar | ||
.toggleClass('expanded') | ||
.css('min-height', ''); | ||
} | ||
if (!topbar.hasClass('expanded')) { | ||
if (!self.rtl) { | ||
@@ -93,5 +90,12 @@ section.css({left: '0%'}); | ||
} | ||
section.find('li.moved').removeClass('moved'); | ||
topbar.data('index', 0); | ||
topbar | ||
.toggleClass('expanded') | ||
.css('min-height', ''); | ||
} | ||
if (!topbar.hasClass('expanded')) { | ||
if (topbar.hasClass('fixed')) { | ||
@@ -106,18 +110,54 @@ topbar.parent().addClass('fixed'); | ||
$('body').css('padding-top','0'); | ||
window.scrollTo(0,0); | ||
if (self.settings.scrolltop) { | ||
window.scrollTo(0,0); | ||
} | ||
} | ||
}) | ||
.on('click.fndtn.topbar', '.top-bar .has-dropdown>a', function (e) { | ||
var topbar = $(this).closest('.top-bar'), | ||
section = topbar.find('section, .section'), | ||
titlebar = topbar.children('ul').first(), | ||
dropdownHeight = $(this).next('.dropdown').outerHeight(); | ||
.on('mouseenter mouseleave', '.top-bar li', function (e) { | ||
if (!self.settings.is_hover) return; | ||
if (Modernizr.touch || self.breakpoint()) { | ||
if (/enter|over/i.test(e.type)) { | ||
$(this).addClass('hover'); | ||
} else { | ||
$(this).removeClass('hover'); | ||
} | ||
}) | ||
.on('click.fndtn.topbar', '.top-bar li.has-dropdown', function (e) { | ||
if (self.breakpoint()) return; | ||
var li = $(this), | ||
target = $(e.target), | ||
topbar = li.closest('[data-topbar], .top-bar'), | ||
is_hover = topbar.data('topbar'); | ||
if (self.settings.is_hover && !Modernizr.touch) return; | ||
e.stopImmediatePropagation(); | ||
if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) { | ||
e.preventDefault(); | ||
} | ||
if (li.hasClass('hover')) { | ||
li | ||
.removeClass('hover') | ||
.find('li') | ||
.removeClass('hover'); | ||
} else { | ||
li.addClass('hover'); | ||
} | ||
}) | ||
.on('click.fndtn.topbar', '.top-bar .has-dropdown>a, [data-topbar] .has-dropdown>a', function (e) { | ||
if (self.breakpoint()) { | ||
e.preventDefault(); | ||
var $this = $(this), | ||
topbar = $this.closest('.top-bar, [data-topbar]'), | ||
section = topbar.find('section, .section'), | ||
titlebar = topbar.children('ul').first(), | ||
dropdownHeight = $this.next('.dropdown').outerHeight(), | ||
$selectedLi = $this.closest('li'); | ||
@@ -127,2 +167,3 @@ | ||
$selectedLi.addClass('moved'); | ||
if (!self.rtl) { | ||
@@ -136,8 +177,3 @@ section.css({left: -(100 * topbar.data('index')) + '%'}); | ||
$('.top-bar').css('min-height', dropdownHeight); | ||
$this.siblings('ul') | ||
.height(topbar.data('height') + self.outerHeight(titlebar, true)); | ||
topbar | ||
.css('min-height', topbar.data('height') + self.outerHeight(titlebar, true) * 2) | ||
topbar.css('min-height', self.height($this.siblings('ul')) + self.outerHeight(titlebar, true)); | ||
} | ||
@@ -148,14 +184,27 @@ }); | ||
if (!self.breakpoint()) { | ||
$('.top-bar') | ||
$('.top-bar, [data-topbar]') | ||
.css('min-height', '') | ||
.removeClass('expanded'); | ||
.removeClass('expanded') | ||
.find('li') | ||
.removeClass('hover'); | ||
} | ||
}.bind(this)); | ||
$('body').on('click.fndtn.topbar', function (e) { | ||
var parent = $(e.target).closest('[data-topbar], .top-bar'); | ||
if (parent.length > 0) { | ||
return; | ||
} | ||
$('.top-bar li, [data-topbar] li').removeClass('hover'); | ||
}); | ||
// Go up a level on Click | ||
$(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back', function (e) { | ||
$(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back, [data-topbar] .has-dropdown .back', function (e) { | ||
e.preventDefault(); | ||
var $this = $(this), | ||
topbar = $this.closest('.top-bar'), | ||
topbar = $this.closest('.top-bar, [data-topbar]'), | ||
titlebar = topbar.children('ul').first(), | ||
section = topbar.find('section, .section'), | ||
@@ -166,2 +215,3 @@ $movedLi = $this.closest('li.moved'), | ||
topbar.data('index', topbar.data('index') - 1); | ||
if (!self.rtl) { | ||
@@ -177,2 +227,4 @@ section.css({left: -(100 * topbar.data('index')) + '%'}); | ||
topbar.css('min-height', 0); | ||
} else { | ||
topbar.css('min-height', self.height($previousLevelUl) + self.outerHeight(titlebar, true)); | ||
} | ||
@@ -198,4 +250,10 @@ | ||
$dropdown = $link.siblings('.dropdown'), | ||
$titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li>'); | ||
url = $link.attr('href'); | ||
if (url && url.length > 1) { | ||
var $titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li><li><a class="parent-link js-generated" href="' + url + '">' + $link.text() +'</a></li>'); | ||
} else { | ||
var $titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li>'); | ||
} | ||
// Copy link to subnav | ||
@@ -217,17 +275,9 @@ if (self.settings.custom_back_text == true) { | ||
largestUL : function () { | ||
var uls = this.settings.$topbar.find('section ul ul'), | ||
largest = uls.first(), | ||
total = 0, | ||
height : function (ul) { | ||
var total = 0, | ||
self = this; | ||
uls.each(function () { | ||
if ($(this).children('li').length > largest.children('li').length) { | ||
largest = $(this); | ||
} | ||
}); | ||
ul.find('> li').each(function () { total += self.outerHeight($(this), true); }); | ||
largest.children('li').each(function () { total += self.outerHeight($(this), true); }); | ||
this.settings.$topbar.data('height', total); | ||
return total; | ||
}, | ||
@@ -259,4 +309,6 @@ | ||
$(window).off('.fndtn.topbar'); | ||
} | ||
}, | ||
reflow : function () {} | ||
}; | ||
}(Foundation.zj, this, this.document)); |
@@ -16,2 +16,3 @@ /* | ||
=require foundation/foundation.topbar | ||
=require foundation/foundation.interchange | ||
*/ |
{ | ||
"name": "foundation", | ||
"version": "4.1.6", | ||
"version": "4.2.1-1", | ||
"main": "stylus/foundation", | ||
"repository" : { | ||
"type" : "git", | ||
"url" : "https://github.com/blai/foundation.git" | ||
}, | ||
"devDependencies": { | ||
@@ -6,0 +10,0 @@ "grunt": "~0.4.0", |
@@ -40,2 +40,3 @@ | ||
* [Reactor](https://github.com/awtheme/reactor) by Anthony Wilhelm using Foundation version 4 | ||
* [Reverie](http://themefortress.com/reverie/) by Zhen using Foundation version 4 | ||
@@ -47,2 +48,4 @@ * [Corner Stone](https://github.com/thewirelessguy/cornerstone) by [Stephen Mullen](https://twitter.com/wirelessguyuk) using Foundation version v4.09 | ||
* [WP-Foundation](http://320press.com/wp-foundation/features/) by 320press using Foundation version 3 | ||
* [f415](https://github.com/javorszky/f415) by Gabor Javorszky | ||
* [Narga Core](https://github.com/Narga/narga-core) by Nguyễn Đình Quân | ||
@@ -60,2 +63,5 @@ Joomla | ||
Alfred | ||
* [Foundation Alfred](https://github.com/joshmedeski/foundation-alfred) by Josh Medeski (@joshmedeski) | ||
PyroCMS | ||
@@ -83,2 +89,3 @@ | ||
* [Magento & Foundation](https://github.com/nandroid/MagentoFoundation) by Nandroid | ||
* [Waterlee Boilerplate](https://github.com/zeljkoprsa/waterlee-boilerplate) by Jake Sharp | ||
@@ -85,0 +92,0 @@ Python |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3445710
214
15758
146
0
2
1