zurb-foundation 3.2.3 → 3.2.4.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/CHANGELOG.md +19 -0
  2. data/README.md +1 -0
  3. data/foundation.gemspec +1 -1
  4. data/lib/foundation/version.rb +1 -1
  5. data/scss/foundation/_settings.scss +8 -3
  6. data/scss/foundation/common/_forms.scss +6 -8
  7. data/scss/foundation/components/_grid.scss +8 -8
  8. data/scss/foundation/components/modules/_buttons.scss +11 -12
  9. data/scss/foundation/components/modules/_clearing.scss +1 -1
  10. data/scss/foundation/components/modules/_mqueries.scss +9 -9
  11. data/scss/foundation/components/modules/_orbit.scss +16 -16
  12. data/scss/foundation/components/modules/_reveal.scss +1 -2
  13. data/scss/foundation/components/modules/_tabs.scss +3 -3
  14. data/scss/foundation/components/modules/_topbar.scss +31 -5
  15. data/scss/foundation/components/modules/_ui.scss +7 -2
  16. data/scss/foundation/mixins/_semantic-grid.scss +3 -3
  17. data/templates/project/scss/_settings.scss +2 -0
  18. data/test/buttons.html +1 -0
  19. data/test/elements.html +1 -1
  20. data/test/grid.html +0 -11
  21. data/test/navigation.html +22 -0
  22. data/test/orbit.html +2 -1
  23. data/test/scss/_settings.scss +2 -0
  24. data/test/topbar-login.html +194 -0
  25. data/test/topbar.html +50 -95
  26. data/vendor/assets/javascripts/foundation/app.js +4 -1
  27. data/vendor/assets/javascripts/foundation/jquery.foundation.accordion.js +33 -24
  28. data/vendor/assets/javascripts/foundation/jquery.foundation.buttons.js +3 -3
  29. data/vendor/assets/javascripts/foundation/jquery.foundation.forms.js +21 -5
  30. data/vendor/assets/javascripts/foundation/jquery.foundation.joyride.js +6 -6
  31. data/vendor/assets/javascripts/foundation/jquery.foundation.magellan.js +29 -22
  32. data/vendor/assets/javascripts/foundation/jquery.foundation.orbit.js +10 -5
  33. data/vendor/assets/javascripts/foundation/jquery.foundation.tabs.js +14 -4
  34. data/vendor/assets/javascripts/foundation/jquery.foundation.tooltips.js +17 -8
  35. data/vendor/assets/javascripts/foundation/jquery.foundation.topbar.js +17 -1
  36. metadata +12 -14
  37. data/marketing/.rbenv-version +0 -1
@@ -30,7 +30,10 @@
30
30
  if (Modernizr.touch && !window.location.hash) {
31
31
  $(window).load(function () {
32
32
  setTimeout(function () {
33
- window.scrollTo(0, 1);
33
+ // At load, if user hasn't scrolled more than 20px or so...
34
+ if( $(window).scrollTop() < 20 ) {
35
+ window.scrollTo(0, 1);
36
+ }
34
37
  }, 0);
35
38
  });
36
39
  }
@@ -2,37 +2,46 @@
2
2
  'use strict';
3
3
 
4
4
  $.fn.foundationAccordion = function (options) {
5
- var $accordion = $('.accordion');
6
5
 
7
- if ($accordion.hasClass('hover') && !Modernizr.touch) {
8
- $('.accordion li', this).on({
9
- mouseenter : function () {
10
- var p = $(this).parent(),
11
- flyout = $(this).children('.content').first();
6
+ // DRY up the logic used to determine if the event logic should execute.
7
+ var hasHover = function(accordion) {
8
+ return accordion.hasClass('hover') && !Modernizr.touch
9
+ };
12
10
 
13
- $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
11
+ $(document).on('mouseenter', '.accordion li', function () {
12
+ var p = $(this).parent();
13
+
14
+ if (hasHover(p)) {
15
+ var flyout = $(this).children('.content').first();
16
+
17
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active');
14
18
  flyout.show(0, function () {
15
19
  flyout.parent('li').addClass('active');
16
20
  });
17
21
  }
18
- });
19
- } else {
20
- $('.accordion li', this).on('click.fndtn', function () {
21
- var li = $(this),
22
- p = $(this).parent(),
23
- flyout = $(this).children('.content').first();
24
-
25
- if (li.hasClass('active')) {
26
- p.find('li').removeClass('active').end().find('.content').hide();
27
- } else {
28
- $('.content', p).not(flyout).hide().parent('li').removeClass('active'); //changed this
29
- flyout.show(0, function () {
30
- flyout.parent('li').addClass('active');
31
- });
22
+ }
23
+ );
24
+
25
+ $(document).on('click.fndtn', '.accordion li .title', function () {
26
+ var li = $(this).closest('li'),
27
+ p = li.parent();
28
+
29
+ if(!hasHover(p)) {
30
+ var flyout = li.children('.content').first();
31
+
32
+ if (li.hasClass('active')) {
33
+ p.find('li').removeClass('active').end().find('.content').hide();
34
+ } else {
35
+ $('.content', p).not(flyout).hide().parent('li').removeClass('active');
36
+ flyout.show(0, function () {
37
+ flyout.parent('li').addClass('active');
38
+ });
39
+ }
32
40
  }
33
- });
34
- }
41
+ }
42
+ );
35
43
 
36
44
  };
37
45
 
38
- })( jQuery, this );
46
+ })( jQuery, this );
47
+
@@ -33,14 +33,14 @@
33
33
  button = $el.closest('.button.dropdown'),
34
34
  dropdown = $('> ul', button);
35
35
 
36
- // If the click is registered on an actual link then do not preventDefault which stops the browser from following the link
37
- if (e.target.nodeName !== "A"){
36
+ // 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
37
+ if (["A", "BUTTON"].indexOf(e.target.nodeName) == -1){
38
38
  e.preventDefault();
39
39
  }
40
40
 
41
41
  // close other dropdowns
42
42
  setTimeout(function () {
43
- closeDropdowns(config.dropdownAsToggle ? dropdown : '');
43
+ closeDropdowns(config.dropdownAsToggle ? '' : dropdown);
44
44
  dropdown.toggleClass('show-dropdown');
45
45
 
46
46
  if (config.dropdownAsToggle) {
@@ -100,7 +100,7 @@
100
100
  $.foundation.customForms.appendCustomMarkup = function ( options ) {
101
101
 
102
102
  var defaults = {
103
- disable_class: "js-disable-custom"
103
+ disable_class: "no-custom"
104
104
  };
105
105
 
106
106
  options = $.extend( defaults, options );
@@ -165,7 +165,7 @@
165
165
  //
166
166
  // Should we not create a custom list?
167
167
  //
168
- if ( $this.hasClass( 'no-custom' ) ) return;
168
+ if ( $this.hasClass( options.disable_class ) ) return;
169
169
 
170
170
  //
171
171
  // Did we not create a custom select element yet?
@@ -186,7 +186,7 @@
186
186
  //
187
187
  // Build our custom list.
188
188
  //
189
- $customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>"');
189
+ $customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>');
190
190
  //
191
191
  // Grab the selector element
192
192
  //
@@ -268,11 +268,11 @@
268
268
  //
269
269
  // Update the custom <ul> list width property.
270
270
  //
271
- $customList.css( 'width', 'inherit' );
271
+ $customList.css( 'width', 'auto' );
272
272
  //
273
273
  // Set the custom select width property.
274
274
  //
275
- $customSelect.css( 'width', 'inherit' );
275
+ $customSelect.css( 'width', 'auto' );
276
276
 
277
277
  //
278
278
  // If we're not specifying a predetermined form size.
@@ -416,10 +416,26 @@
416
416
  if ($associatedElement.attr('type') === 'checkbox') {
417
417
  event.preventDefault();
418
418
  $customCheckbox = $(this).find('span.custom.checkbox');
419
+ //the checkbox might be outside after the label
420
+ if ($customCheckbox.length == 0) {
421
+ $customCheckbox = $(this).next('span.custom.checkbox');
422
+ }
423
+ //the checkbox might be outside before the label
424
+ if ($customCheckbox.length == 0) {
425
+ $customCheckbox = $(this).prev('span.custom.checkbox');
426
+ }
419
427
  toggleCheckbox($customCheckbox);
420
428
  } else if ($associatedElement.attr('type') === 'radio') {
421
429
  event.preventDefault();
422
430
  $customRadio = $(this).find('span.custom.radio');
431
+ //the radio might be outside after the label
432
+ if ($customRadio.length == 0) {
433
+ $customRadio = $(this).next('span.custom.radio');
434
+ }
435
+ //the radio might be outside before the label
436
+ if ($customRadio.length == 0) {
437
+ $customRadio = $(this).prev('span.custom.radio');
438
+ }
423
439
  toggleRadio($customRadio);
424
440
  }
425
441
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * jQuery Foundation Joyride Plugin 2.0.2
2
+ * jQuery Foundation Joyride Plugin 2.0.3
3
3
  * http://foundation.zurb.com
4
4
  * Copyright 2012, ZURB
5
5
  * Free to use under the MIT license.
@@ -12,7 +12,7 @@
12
12
  'use strict';
13
13
 
14
14
  var defaults = {
15
- 'version' : '2.0.1',
15
+ 'version' : '2.0.3',
16
16
  'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent
17
17
  'nubPosition' : 'auto', // override on a per tooltip bases
18
18
  'scrollSpeed' : 300, // Page scrolling speed in milliseconds
@@ -48,9 +48,9 @@
48
48
  return this.each(function () {
49
49
 
50
50
  if ($.isEmptyObject(settings)) {
51
- settings = $.extend(defaults, opts);
51
+ settings = $.extend(true, defaults, opts);
52
52
 
53
- // non configureable settings
53
+ // non configurable settings
54
54
  settings.document = window.document;
55
55
  settings.$document = $(settings.document);
56
56
  settings.$window = $(window);
@@ -174,7 +174,7 @@
174
174
  },
175
175
 
176
176
  create : function (opts) {
177
- // backwards compatability with data-text attribute
177
+ // backwards compatibility with data-text attribute
178
178
  var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
179
179
  tipClass = opts.$li.attr('class'),
180
180
  $tip_content = $(methods.tip_template({
@@ -273,7 +273,7 @@
273
273
 
274
274
  settings.$current_tip = settings.$next_tip;
275
275
 
276
- // skip non-existant targets
276
+ // skip non-existent targets
277
277
  } else if (settings.$li && settings.$target.length < 1) {
278
278
 
279
279
  methods.show();
@@ -12,24 +12,26 @@
12
12
  'use strict';
13
13
 
14
14
  $.fn.foundationMagellan = function(options) {
15
- var $fixedMagellan = $('[data-magellan-expedition=fixed]'),
15
+ var $window = $(window),
16
+ $document = $(document),
17
+ $fixedMagellan = $('[data-magellan-expedition=fixed]'),
16
18
  defaults = {
17
- threshold: ($fixedMagellan.length) ? $fixedMagellan.outerHeight(true) : 25,
18
- activeClass: 'active'
19
- },
20
-
21
- options = $.extend({}, defaults, options);
22
-
19
+ threshold: ($fixedMagellan.length) ? $fixedMagellan.outerHeight(true) : 0,
20
+ activeClass: 'active'
21
+ },
22
+ options = $.extend({}, defaults, options);
23
+
23
24
  // Indicate we have arrived at a destination
24
- $(document).on('magellan.arrival', '[data-magellan-arrival]', function(e) {
25
- var $expedition = $(this).closest('[data-magellan-expedition]'),
26
- activeClass = $expedition.attr('data-magellan-active-class') || options.activeClass;
27
- $(this)
25
+ $document.on('magellan.arrival', '[data-magellan-arrival]', function(e) {
26
+ var $destination = $(this),
27
+ $expedition = $destination.closest('[data-magellan-expedition]'),
28
+ activeClass = $expedition.attr('data-magellan-active-class') || options.activeClass;
29
+ $destination
28
30
  .closest('[data-magellan-expedition]')
29
31
  .find('[data-magellan-arrival]')
30
32
  .not(this)
31
33
  .removeClass(activeClass);
32
- $(this).addClass(activeClass);
34
+ $destination.addClass(activeClass);
33
35
  });
34
36
 
35
37
  // Set starting point as the current destination
@@ -42,16 +44,15 @@
42
44
  var $el = $(this);
43
45
  $el.data("magellan-fixed-position","");
44
46
  $el.data("magellan-top-offset", "");
45
- });
47
+ })
48
+ .trigger('magellan.update-position');
46
49
 
47
- $fixedMagellan.trigger('magellan.update-position');
48
-
49
- $(window).on('resize.magellan', function() {
50
+ $window.on('resize.magellan', function() {
50
51
  $fixedMagellan.trigger('magellan.update-position');
51
52
  });
52
53
 
53
- $(window).on('scroll.magellan', function() {
54
- var windowScrollTop = $(window).scrollTop();
54
+ $window.on('scroll.magellan', function() {
55
+ var windowScrollTop = $window.scrollTop();
55
56
  $fixedMagellan.each(function() {
56
57
  var $expedition = $(this);
57
58
  if ($expedition.data("magellan-top-offset") === "") {
@@ -70,15 +71,21 @@
70
71
  });
71
72
 
72
73
  // Determine when a destination has been reached, ah0y!
73
- $(window).on('scroll.magellan', function(e){
74
- var windowScrollTop = $(window).scrollTop();
74
+ var $lastDestination = $('[data-magellan-destination]:last');
75
+ $window.on('scroll.magellan', function(e){
76
+ var windowScrollTop = $window.scrollTop(),
77
+ scrolltopPlusHeight = windowScrollTop+$window.outerHeight(true),
78
+ lastDestinationTop = Math.ceil($lastDestination.offset().top);
75
79
  $('[data-magellan-destination]').each(function(){
76
80
  var $destination = $(this),
77
81
  destination_name = $destination.attr('data-magellan-destination'),
78
82
  topOffset = $destination.offset().top - windowScrollTop;
79
83
  if (topOffset <= options.threshold) {
80
- $('[data-magellan-arrival=' + destination_name + ']')
81
- .trigger('magellan.arrival');
84
+ $('[data-magellan-arrival=' + destination_name + ']').trigger('magellan.arrival');
85
+ }
86
+ // 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
87
+ if (scrolltopPlusHeight >= $document.outerHeight(true) && lastDestinationTop > windowScrollTop && lastDestinationTop < scrolltopPlusHeight) {
88
+ $('[data-magellan-arrival]:last').trigger('magellan.arrival');
82
89
  }
83
90
  });
84
91
  });
@@ -37,6 +37,7 @@
37
37
  bullets: false, // true or false to activate the bullet navigation
38
38
  bulletThumbs: false, // thumbnails for the bullets
39
39
  bulletThumbLocation: '', // relative path to thumbnails from this file
40
+ bulletThumbsHideOnSmall: true, // hide thumbs on small devices
40
41
  afterSlideChange: $.noop, // callback to execute after slide changes
41
42
  afterLoadComplete: $.noop, // callback to execute after everything has been loaded
42
43
  fluid: true,
@@ -81,7 +82,7 @@
81
82
 
82
83
  this.$element = $(element);
83
84
  this.$wrapper = this.$element.wrap(this.wrapperHTML).parent();
84
- this.$slides = this.$element.children('img, a, div, figure');
85
+ this.$slides = this.$element.children('img, a, div, figure, li');
85
86
 
86
87
  this.$element.on('movestart', function(e) {
87
88
  // If the movestart is heading off in an upwards or downwards
@@ -143,7 +144,7 @@
143
144
  this.$element.addClass('orbit-stack-on-small');
144
145
  }
145
146
 
146
- this.$slides.addClass('orbit-slide');
147
+ this.$slides.addClass('orbit-slide').css({"opacity" : 0});
147
148
 
148
149
  this.setDimentionsFromLargestSlide();
149
150
  this.updateOptionsIfOnlyOneSlide();
@@ -387,11 +388,12 @@
387
388
  if ($.trim($(captionLocation).text()).length < 1){
388
389
  return false;
389
390
  }
391
+
390
392
  // if location selector starts with '#', remove it so we don't see id="#selector"
391
393
  if (captionLocation.charAt(0) == '#') {
392
394
  captionLocation = captionLocation.substring(1, captionLocation.length);
393
395
  }
394
- captionHTML = $(captionLocation).html(); //get HTML from the matching HTML entity
396
+ captionHTML = $('#' + captionLocation).html(); //get HTML from the matching HTML entity
395
397
  this.$caption
396
398
  .attr('id', captionLocation) // Add ID caption TODO why is the id being set?
397
399
  .html(captionHTML); // Change HTML in Caption
@@ -457,6 +459,7 @@
457
459
  this.$slides.each(this.addBullet);
458
460
  this.$element.addClass('with-bullets');
459
461
  if (this.options.centerBullets) this.$bullets.css('margin-left', -this.$bullets.outerWidth() / 2);
462
+ if (this.options.bulletThumbsHideOnSmall) this.$bullets.addClass('hide-for-small');
460
463
  },
461
464
 
462
465
  addBullet: function (index, slide) {
@@ -654,7 +657,9 @@
654
657
  this.setCaption();
655
658
  }
656
659
 
657
- if (this.$slides.last() && this.options.singleCycle) {
660
+ // if on last slide and singleCycle is true, don't loop through slides again
661
+ // .length is zero based so must minus 1 to match activeSlide index
662
+ if (this.activeSlide === this.$slides.length-1 && this.options.singleCycle) {
658
663
  this.stopClock();
659
664
  }
660
665
  }
@@ -867,7 +872,7 @@ app.run = function (o) {
867
872
  for (var l = images.length, i = 0; i < l; i++) {
868
873
  var theme = settings.themes.gray;
869
874
  var src = images[i].getAttribute("data-src") || images[i].getAttribute("src");
870
- if ( !! ~src.indexOf(options.domain)) {
875
+ if (src && !! ~src.indexOf(options.domain)) {
871
876
  var render = false,
872
877
  dimensions = null,
873
878
  text = null;
@@ -3,15 +3,18 @@
3
3
 
4
4
  var settings = {
5
5
  callback: $.noop,
6
+ deep_linking: true,
6
7
  init: false
7
- },
8
+ },
8
9
 
9
10
  methods = {
10
11
  init : function (options) {
11
- settings = $.extend({}, options, settings);
12
+ settings = $.extend({}, settings, options);
12
13
 
13
14
  return this.each(function () {
14
15
  if (!settings.init) methods.events();
16
+
17
+ if (settings.deep_linking) methods.from_hash();
15
18
  });
16
19
  },
17
20
 
@@ -31,7 +34,7 @@
31
34
 
32
35
  if (hasHash && $content.length > 0) {
33
36
  // Show tab content
34
- e.preventDefault();
37
+ if (e && !settings.deep_linking) e.preventDefault();
35
38
  $content.closest('.tabs-content').children('li').removeClass('active').hide();
36
39
  $content.css('display', 'block').addClass('active');
37
40
  }
@@ -41,6 +44,13 @@
41
44
  $tab.addClass('active');
42
45
 
43
46
  settings.callback();
47
+ },
48
+
49
+ from_hash : function () {
50
+ var hash = window.location.hash,
51
+ $tab = $('a[href="' + hash + '"]');
52
+
53
+ $tab.trigger('click.fndtn');
44
54
  }
45
55
  }
46
56
 
@@ -53,4 +63,4 @@
53
63
  $.error('Method ' + method + ' does not exist on jQuery.foundationTabs');
54
64
  }
55
65
  };
56
- }(jQuery, this, this.document));
66
+ }(jQuery, this, this.document));
@@ -10,7 +10,7 @@
10
10
 
11
11
  ;(function ($, window, undefined) {
12
12
  'use strict';
13
-
13
+
14
14
  var settings = {
15
15
  bodyHeight : 0,
16
16
  selector : '.has-tip',
@@ -56,13 +56,13 @@
56
56
 
57
57
  });
58
58
  },
59
- showOrCreateTip : function ($target) {
59
+ showOrCreateTip : function ($target, content) {
60
60
  var $tip = methods.getTip($target);
61
61
 
62
62
  if ($tip && $tip.length > 0) {
63
63
  methods.show($target);
64
64
  } else {
65
- methods.create($target);
65
+ methods.create($target, content);
66
66
  }
67
67
  },
68
68
  getTip : function ($target) {
@@ -84,8 +84,9 @@
84
84
  }
85
85
  return (id) ? id : dataSelector;
86
86
  },
87
- create : function ($target) {
88
- var $tip = $(settings.tipTemplate(methods.selector($target), $('<div>').html($target.attr('title')).html())),
87
+ create : function ($target, content) {
88
+ var $tip = $(settings.tipTemplate(methods.selector($target),
89
+ $('<div>').html(content ? content : $target.attr('title')).html())),
89
90
  classes = methods.inheritable_classes($target);
90
91
 
91
92
  $tip.addClass(classes).appendTo('body');
@@ -111,7 +112,7 @@
111
112
  'bottom' : bottom,
112
113
  'left' : left,
113
114
  'right' : right,
114
- 'width' : (width) ? width : 'auto'
115
+ 'max-width' : (width) ? width : 'auto'
115
116
  }).end();
116
117
  };
117
118
 
@@ -140,19 +141,27 @@
140
141
  objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left + target.outerWidth() + 10), width)
141
142
  .removeClass('tip-override');
142
143
  objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), 'auto', 'auto', -nubHeight);
144
+ } else if (classes && classes.indexOf('tip-centered-top') > -1) {
145
+ objPos(tip, (target.offset().top - tip.outerHeight() - nubHeight), 'auto', 'auto', (target.offset().left + ((target.outerWidth() - tip.outerWidth()) / 2) ), width)
146
+ .removeClass('tip-override');
147
+ objPos(nub, 'auto', ((tip.outerWidth() / 2) -(nubHeight / 2)), -nubHeight, 'auto');
148
+ } else if (classes && classes.indexOf('tip-centered-bottom') > -1) {
149
+ objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', (target.offset().left + ((target.outerWidth() - tip.outerWidth()) / 2) ), width)
150
+ .removeClass('tip-override');
151
+ objPos(nub, -nubHeight, ((tip.outerWidth() / 2) -(nubHeight / 2)), 'auto', 'auto');
143
152
  }
144
153
  }
145
154
  tip.css('visibility', 'visible').hide();
146
155
  },
147
156
  inheritable_classes : function (target) {
148
- var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'].concat(settings.additionalInheritableClasses),
157
+ var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'tip-centered-top', 'tip-centered-bottom', 'noradius'].concat(settings.additionalInheritableClasses),
149
158
  classes = target.attr('class'),
150
159
  filtered = classes ? $.map(classes.split(' '), function (el, i) {
151
160
  if ($.inArray(el, inheritables) !== -1) {
152
161
  return el;
153
162
  }
154
163
  }).join(' ') : '';
155
-
164
+
156
165
  return $.trim(filtered);
157
166
  },
158
167
  show : function ($target) {