foundation-rails 5.5.1.2 → 5.5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/bower.json +2 -2
  2. data/lib/foundation/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/foundation.js +1 -1
  4. data/vendor/assets/javascripts/foundation/foundation.abide.js +96 -28
  5. data/vendor/assets/javascripts/foundation/foundation.accordion.js +28 -7
  6. data/vendor/assets/javascripts/foundation/foundation.alert.js +3 -3
  7. data/vendor/assets/javascripts/foundation/foundation.clearing.js +50 -20
  8. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +26 -11
  9. data/vendor/assets/javascripts/foundation/foundation.equalizer.js +43 -16
  10. data/vendor/assets/javascripts/foundation/foundation.interchange.js +19 -14
  11. data/vendor/assets/javascripts/foundation/foundation.joyride.js +1 -1
  12. data/vendor/assets/javascripts/foundation/foundation.js +51 -29
  13. data/vendor/assets/javascripts/foundation/foundation.magellan.js +40 -28
  14. data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +3 -3
  15. data/vendor/assets/javascripts/foundation/foundation.orbit.js +1 -1
  16. data/vendor/assets/javascripts/foundation/foundation.reveal.js +70 -43
  17. data/vendor/assets/javascripts/foundation/foundation.slider.js +23 -5
  18. data/vendor/assets/javascripts/foundation/foundation.tab.js +30 -18
  19. data/vendor/assets/javascripts/foundation/foundation.tooltip.js +47 -15
  20. data/vendor/assets/javascripts/foundation/foundation.topbar.js +31 -25
  21. data/vendor/assets/stylesheets/foundation.scss +37 -38
  22. data/vendor/assets/stylesheets/foundation/_functions.scss +52 -42
  23. data/vendor/assets/stylesheets/foundation/_settings.scss +53 -34
  24. data/vendor/assets/stylesheets/foundation/components/_accordion.scss +7 -7
  25. data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +11 -11
  26. data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +13 -13
  27. data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +17 -18
  28. data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +29 -22
  29. data/vendor/assets/stylesheets/foundation/components/_buttons.scss +13 -17
  30. data/vendor/assets/stylesheets/foundation/components/_clearing.scss +51 -47
  31. data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +10 -11
  32. data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +42 -36
  33. data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +7 -7
  34. data/vendor/assets/stylesheets/foundation/components/_forms.scss +82 -50
  35. data/vendor/assets/stylesheets/foundation/components/_global.scss +86 -64
  36. data/vendor/assets/stylesheets/foundation/components/_grid.scss +24 -21
  37. data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +335 -234
  38. data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +8 -8
  39. data/vendor/assets/stylesheets/foundation/components/_joyride.scss +40 -42
  40. data/vendor/assets/stylesheets/foundation/components/_keystrokes.scss +2 -3
  41. data/vendor/assets/stylesheets/foundation/components/_labels.scss +6 -6
  42. data/vendor/assets/stylesheets/foundation/components/_magellan.scss +2 -2
  43. data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +178 -175
  44. data/vendor/assets/stylesheets/foundation/components/_orbit.scss +82 -62
  45. data/vendor/assets/stylesheets/foundation/components/_pagination.scss +15 -15
  46. data/vendor/assets/stylesheets/foundation/components/_panels.scss +21 -15
  47. data/vendor/assets/stylesheets/foundation/components/_pricing-tables.scss +16 -16
  48. data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +4 -4
  49. data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +23 -16
  50. data/vendor/assets/stylesheets/foundation/components/_reveal.scss +27 -27
  51. data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +15 -11
  52. data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +16 -16
  53. data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +14 -11
  54. data/vendor/assets/stylesheets/foundation/components/_switches.scss +22 -19
  55. data/vendor/assets/stylesheets/foundation/components/_tables.scss +8 -8
  56. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +49 -32
  57. data/vendor/assets/stylesheets/foundation/components/_thumbs.scss +8 -8
  58. data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +25 -25
  59. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +163 -122
  60. data/vendor/assets/stylesheets/foundation/components/_type.scss +19 -19
  61. data/vendor/assets/stylesheets/foundation/components/_visibility.scss +23 -5
  62. data/vendor/assets/stylesheets/normalize.scss +8 -11
  63. metadata +28 -20
  64. checksums.yaml +0 -7
  65. data/vendor/assets/stylesheets/foundation/components/_toolbar.scss +0 -72
@@ -4,7 +4,7 @@
4
4
  Foundation.libs.tooltip = {
5
5
  name : 'tooltip',
6
6
 
7
- version : '5.5.1',
7
+ version : '5.5.2',
8
8
 
9
9
  settings : {
10
10
  additional_inheritable_classes : [],
@@ -57,6 +57,31 @@
57
57
 
58
58
  self.create(this.S(instance));
59
59
 
60
+ function _startShow(elt, $this, immediate) {
61
+ if (elt.timer) {
62
+ return;
63
+ }
64
+
65
+ if (immediate) {
66
+ elt.timer = null;
67
+ self.showTip($this);
68
+ } else {
69
+ elt.timer = setTimeout(function () {
70
+ elt.timer = null;
71
+ self.showTip($this);
72
+ }.bind(elt), self.settings.hover_delay);
73
+ }
74
+ }
75
+
76
+ function _startHide(elt, $this) {
77
+ if (elt.timer) {
78
+ clearTimeout(elt.timer);
79
+ elt.timer = null;
80
+ }
81
+
82
+ self.hide($this);
83
+ }
84
+
60
85
  $(this.scope)
61
86
  .off('.tooltip')
62
87
  .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',
@@ -72,7 +97,7 @@
72
97
  if (/mouse/i.test(e.type) && self.ie_touch(e)) {
73
98
  return false;
74
99
  }
75
-
100
+
76
101
  if ($this.hasClass('open')) {
77
102
  if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
78
103
  e.preventDefault();
@@ -85,17 +110,20 @@
85
110
  e.preventDefault();
86
111
  S(settings.tooltip_class + '.open').hide();
87
112
  is_touch = true;
113
+ // close other open tooltips on touch
114
+ if ($('.open[' + self.attr_name() + ']').length > 0) {
115
+ var prevOpen = S($('.open[' + self.attr_name() + ']')[0]);
116
+ self.hide(prevOpen);
117
+ }
88
118
  }
89
119
 
90
120
  if (/enter|over/i.test(e.type)) {
91
- this.timer = setTimeout(function () {
92
- var tip = self.showTip($this);
93
- }.bind(this), self.settings.hover_delay);
121
+ _startShow(this, $this);
122
+
94
123
  } else if (e.type === 'mouseout' || e.type === 'mouseleave') {
95
- clearTimeout(this.timer);
96
- self.hide($this);
124
+ _startHide(this, $this);
97
125
  } else {
98
- self.showTip($this);
126
+ _startShow(this, $this, true);
99
127
  }
100
128
  }
101
129
  })
@@ -109,11 +137,11 @@
109
137
  } else if ($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
110
138
  self.convert_to_touch($(this));
111
139
  } else {
112
- self.hide($(this));
140
+ _startHide(this, $(this));
113
141
  }
114
142
  })
115
143
  .on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) {
116
- self.hide(S(this));
144
+ _startHide(this, S(this));
117
145
  });
118
146
  },
119
147
 
@@ -143,17 +171,16 @@
143
171
  },
144
172
 
145
173
  selector : function ($target) {
146
- var id = $target.attr('id'),
147
- dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
174
+ var dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
148
175
 
149
- if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') {
176
+ if (typeof dataSelector != 'string') {
150
177
  dataSelector = this.random_str(6);
151
178
  $target
152
179
  .attr('data-selector', dataSelector)
153
180
  .attr('aria-describedby', dataSelector);
154
181
  }
155
182
 
156
- return (id && id.length > 0) ? id : dataSelector;
183
+ return dataSelector;
157
184
  },
158
185
 
159
186
  create : function ($target) {
@@ -217,7 +244,13 @@
217
244
  nub.addClass('rtl');
218
245
  left = target.offset().left + target.outerWidth() - tip.outerWidth();
219
246
  }
247
+
220
248
  objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left);
249
+ // reset nub from small styles, if they've been applied
250
+ if (nub.attr('style')) {
251
+ nub.removeAttr('style');
252
+ }
253
+
221
254
  tip.removeClass('tip-override');
222
255
  if (classes && classes.indexOf('tip-top') > -1) {
223
256
  if (Foundation.rtl) {
@@ -286,7 +319,6 @@
286
319
 
287
320
  hide : function ($target) {
288
321
  var $tip = this.getTip($target);
289
-
290
322
  $tip.fadeOut(150, function () {
291
323
  $tip.find('.tap-to-close').remove();
292
324
  $tip.off('click.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose');
@@ -4,17 +4,19 @@
4
4
  Foundation.libs.topbar = {
5
5
  name : 'topbar',
6
6
 
7
- version : '5.5.1',
7
+ version : '5.5.2',
8
8
 
9
9
  settings : {
10
10
  index : 0,
11
+ start_offset : 0,
11
12
  sticky_class : 'sticky',
12
13
  custom_back_text : true,
13
14
  back_text : 'Back',
14
15
  mobile_show_parent_link : true,
15
16
  is_hover : true,
16
17
  scrolltop : true, // jump to top when sticky nav menu toggle is clicked
17
- sticky_on : 'all'
18
+ sticky_on : 'all',
19
+ dropdown_autoclose: true
18
20
  },
19
21
 
20
22
  init : function (section, method, options) {
@@ -65,24 +67,20 @@
65
67
  var smallMatch = matchMedia(Foundation.media_queries.small).matches;
66
68
  var medMatch = matchMedia(Foundation.media_queries.medium).matches;
67
69
  var lrgMatch = matchMedia(Foundation.media_queries.large).matches;
68
-
69
- if (sticky && settings.sticky_on === 'all') {
70
- return true;
71
- }
72
- if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {
73
- if (smallMatch && !medMatch && !lrgMatch) { return true; }
74
- }
75
- if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {
76
- if (smallMatch && medMatch && !lrgMatch) { return true; }
77
- }
78
- if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {
79
- if (smallMatch && medMatch && lrgMatch) { return true; }
80
- }
81
-
82
- // fix for iOS browsers
83
- if (sticky && navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
70
+
71
+ if (sticky && settings.sticky_on === 'all') {
84
72
  return true;
85
- }
73
+ }
74
+ if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {
75
+ if (smallMatch && !medMatch && !lrgMatch) { return true; }
76
+ }
77
+ if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {
78
+ if (smallMatch && medMatch && !lrgMatch) { return true; }
79
+ }
80
+ if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {
81
+ if (smallMatch && medMatch && lrgMatch) { return true; }
82
+ }
83
+
86
84
  return false;
87
85
  },
88
86
 
@@ -166,11 +164,19 @@
166
164
  e.preventDefault();
167
165
  self.toggle(this);
168
166
  })
169
- .on('click.fndtn.topbar', '.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]', function (e) {
170
- var li = $(this).closest('li');
167
+ .on('click.fndtn.topbar contextmenu.fndtn.topbar', '.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]', function (e) {
168
+ var li = $(this).closest('li'),
169
+ topbar = li.closest('[' + self.attr_name() + ']'),
170
+ settings = topbar.data(self.attr_name(true) + '-init');
171
+
172
+ if (settings.dropdown_autoclose && settings.is_hover) {
173
+ var hoverLi = $(this).closest('.hover');
174
+ hoverLi.removeClass('hover');
175
+ }
171
176
  if (self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) {
172
177
  self.toggle();
173
178
  }
179
+
174
180
  })
175
181
  .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
176
182
  var li = S(this),
@@ -239,7 +245,7 @@
239
245
 
240
246
  S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
241
247
  self.resize.call(self);
242
- }, 50)).trigger('resize').trigger('resize.fndtn.topbar').load(function () {
248
+ }, 50)).trigger('resize.fndtn.topbar').load(function () {
243
249
  // Ensure that the offset is calculated after all of the pages resources have loaded
244
250
  S(this).trigger('resize.fndtn.topbar');
245
251
  });
@@ -372,7 +378,7 @@
372
378
  if (!$dropdown.find('.title.back').length) {
373
379
 
374
380
  if (settings.mobile_show_parent_link == true && url) {
375
- $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link hide-for-large-up"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
381
+ $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
376
382
  } else {
377
383
  $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
378
384
  }
@@ -424,8 +430,8 @@
424
430
  $window = this.S(window),
425
431
  self = this;
426
432
 
427
- if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar, this.settings.sticky_topbar.parent(), this.settings)) {
428
- var distance = this.settings.sticky_topbar.data('stickyoffset');
433
+ if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {
434
+ var distance = this.settings.sticky_topbar.data('stickyoffset') + this.settings.start_offset;
429
435
  if (!self.S(klass).hasClass('expanded')) {
430
436
  if ($window.scrollTop() > (distance)) {
431
437
  if (!self.S(klass).hasClass('fixed')) {
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  // Foundation by ZURB
3
2
  // foundation.zurb.com
4
3
  // Licensed under MIT Open Source
@@ -6,40 +5,40 @@
6
5
  // Make sure the charset is set appropriately
7
6
 
8
7
  // Behold, here are all the Foundation components.
9
- @import "foundation/components/grid";
10
- @import "foundation/components/accordion";
11
- @import "foundation/components/alert-boxes";
12
- @import "foundation/components/block-grid";
13
- @import "foundation/components/breadcrumbs";
14
- @import "foundation/components/button-groups";
15
- @import "foundation/components/buttons";
16
- @import "foundation/components/clearing";
17
- @import "foundation/components/dropdown";
18
- @import "foundation/components/dropdown-buttons";
19
- @import "foundation/components/flex-video";
20
- @import "foundation/components/forms";
21
- @import "foundation/components/icon-bar";
22
- @import "foundation/components/inline-lists";
23
- @import "foundation/components/joyride";
24
- @import "foundation/components/keystrokes";
25
- @import "foundation/components/labels";
26
- @import "foundation/components/magellan";
27
- @import "foundation/components/orbit";
28
- @import "foundation/components/pagination";
29
- @import "foundation/components/panels";
30
- @import "foundation/components/pricing-tables";
31
- @import "foundation/components/progress-bars";
32
- @import "foundation/components/range-slider";
33
- @import "foundation/components/reveal";
34
- @import "foundation/components/side-nav";
35
- @import "foundation/components/split-buttons";
36
- @import "foundation/components/sub-nav";
37
- @import "foundation/components/switches";
38
- @import "foundation/components/tables";
39
- @import "foundation/components/tabs";
40
- @import "foundation/components/thumbs";
41
- @import "foundation/components/tooltips";
42
- @import "foundation/components/top-bar";
43
- @import "foundation/components/type";
44
- @import "foundation/components/offcanvas";
45
- @import "foundation/components/visibility";
8
+ @import 'foundation/components/grid';
9
+ @import 'foundation/components/accordion';
10
+ @import 'foundation/components/alert-boxes';
11
+ @import 'foundation/components/block-grid';
12
+ @import 'foundation/components/breadcrumbs';
13
+ @import 'foundation/components/button-groups';
14
+ @import 'foundation/components/buttons';
15
+ @import 'foundation/components/clearing';
16
+ @import 'foundation/components/dropdown';
17
+ @import 'foundation/components/dropdown-buttons';
18
+ @import 'foundation/components/flex-video';
19
+ @import 'foundation/components/forms';
20
+ @import 'foundation/components/icon-bar';
21
+ @import 'foundation/components/inline-lists';
22
+ @import 'foundation/components/joyride';
23
+ @import 'foundation/components/keystrokes';
24
+ @import 'foundation/components/labels';
25
+ @import 'foundation/components/magellan';
26
+ @import 'foundation/components/orbit';
27
+ @import 'foundation/components/pagination';
28
+ @import 'foundation/components/panels';
29
+ @import 'foundation/components/pricing-tables';
30
+ @import 'foundation/components/progress-bars';
31
+ @import 'foundation/components/range-slider';
32
+ @import 'foundation/components/reveal';
33
+ @import 'foundation/components/side-nav';
34
+ @import 'foundation/components/split-buttons';
35
+ @import 'foundation/components/sub-nav';
36
+ @import 'foundation/components/switches';
37
+ @import 'foundation/components/tables';
38
+ @import 'foundation/components/tabs';
39
+ @import 'foundation/components/thumbs';
40
+ @import 'foundation/components/tooltips';
41
+ @import 'foundation/components/top-bar';
42
+ @import 'foundation/components/type';
43
+ @import 'foundation/components/offcanvas';
44
+ @import 'foundation/components/visibility';
@@ -8,6 +8,7 @@ $rem-base: 16px !default;
8
8
  // IMPORT ONCE
9
9
  // We use this to prevent styles from being loaded multiple times for components that rely on other components.
10
10
  $modules: () !default;
11
+
11
12
  @mixin exports($name) {
12
13
  // Import from global scope
13
14
  $modules: $modules !global;
@@ -26,11 +27,11 @@ $modules: () !default;
26
27
 
27
28
  // RANGES
28
29
  // We use these functions to define ranges for various things, like media queries.
29
- @function lower-bound($range){
30
+ @function lower-bound($range) {
30
31
  @if length($range) <= 0 {
31
32
  @return 0;
32
33
  }
33
- @return nth($range,1);
34
+ @return nth($range, 1);
34
35
  }
35
36
 
36
37
  @function upper-bound($range) {
@@ -50,45 +51,45 @@ $modules: () !default;
50
51
 
51
52
  @function text-inputs( $types: all, $selector: input ) {
52
53
 
53
- $return: ();
54
-
55
- $all-text-input-types:
56
- text
57
- password
58
- date
59
- datetime
60
- datetime-local
61
- month
62
- week
63
- email
64
- number
65
- search
66
- tel
67
- time
68
- url
69
- color
70
- textarea;
71
-
72
- @if $types == all { $types: $all-text-input-types; }
73
-
74
- @each $type in $types {
75
- @if $type == textarea {
76
- @if $selector == input {
77
- $return: append($return, unquote('#{$type}'), comma)
78
- } @else {
79
- $return: append($return, unquote('#{$type}#{$selector}'), comma)
80
- }
81
- } @else {
82
- $return: append($return, unquote('#{$selector}[type="#{$type}"]'), comma)
83
- }
54
+ $return: ();
55
+
56
+ $all-text-input-types:
57
+ text
58
+ password
59
+ date
60
+ datetime
61
+ datetime-local
62
+ month
63
+ week
64
+ email
65
+ number
66
+ search
67
+ tel
68
+ time
69
+ url
70
+ color
71
+ textarea;
72
+
73
+ @if $types == all { $types: $all-text-input-types; }
74
+
75
+ @each $type in $types {
76
+ @if $type == textarea {
77
+ @if $selector == input {
78
+ $return: append($return, unquote('#{$type}'), comma)
79
+ } @else {
80
+ $return: append($return, unquote('#{$type}#{$selector}'), comma)
81
+ }
82
+ } @else {
83
+ $return: append($return, unquote('#{$selector}[type="#{$type}"]'), comma)
84
84
  }
85
+ }
85
86
 
86
87
  @return $return;
87
88
 
88
89
  }
89
90
 
90
91
  // CONVERT TO REM
91
- @function convert-to-rem($value, $base-value: $rem-base) {
92
+ @function convert-to-rem($value, $base-value: $rem-base) {
92
93
  $value: strip-unit($value) / strip-unit($base-value) * 1rem;
93
94
  @if ($value == 0rem) { $value: 0; } // Turn 0rem into 0
94
95
  @return $value;
@@ -133,14 +134,23 @@ $modules: () !default;
133
134
  @return $remValues;
134
135
  }
135
136
 
136
- // OLD EM CALC
137
- // Deprecated: We'll drop support for this in 5.1.0, use rem-calc()
138
- @function emCalc($values){
139
- @return rem-calc($values);
137
+
138
+ @function em-calc($values) {
139
+ $remValues: rem-calc($values);
140
+
141
+ $max: length($remValues);
142
+
143
+ @if $max == 1 { @return strip-unit(nth($remValues, 1)) * 1em; }
144
+
145
+ $emValues: ();
146
+ @for $i from 1 through $max {
147
+ $emValues: append($emValues, strip-unit(nth($remValues, $i)) * 1em);
148
+ }
149
+ @return $emValues;
140
150
  }
141
151
 
142
- // OLD EM CALC
143
- // Deprecated: We'll drop support for this in 5.1.0, use rem-calc()
144
- @function em-calc($values){
145
- @return rem-calc($values);
152
+
153
+ // Deprecated: OLD EM CALC
154
+ @function emCalc($values) {
155
+ @return em-calc($values);
146
156
  }