paint-rails 0.6.7 → 0.7.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/lib/paint-rails/version.rb +1 -1
  4. data/paint-rails.gemspec +2 -2
  5. data/vendor/assets/stylesheets/Brocfile.js +3 -0
  6. data/vendor/assets/stylesheets/Gemfile +3 -0
  7. data/vendor/assets/stylesheets/Gemfile.lock +14 -0
  8. data/vendor/assets/stylesheets/bin/ci +6 -0
  9. data/vendor/assets/stylesheets/bin/lint +5 -0
  10. data/vendor/assets/stylesheets/bin/setup +7 -0
  11. data/vendor/assets/stylesheets/bower_components/fontawesome/.bower.json +5 -5
  12. data/vendor/assets/stylesheets/bower_components/fontawesome/.gitignore +1 -0
  13. data/vendor/assets/stylesheets/bower_components/fontawesome/bower.json +1 -1
  14. data/vendor/assets/stylesheets/bower_components/fontawesome/css/font-awesome.css +133 -4
  15. data/vendor/assets/stylesheets/bower_components/fontawesome/css/font-awesome.css.map +7 -0
  16. data/vendor/assets/stylesheets/bower_components/fontawesome/css/font-awesome.min.css +2 -2
  17. data/vendor/assets/stylesheets/bower_components/fontawesome/fonts/FontAwesome.otf +0 -0
  18. data/vendor/assets/stylesheets/bower_components/fontawesome/fonts/fontawesome-webfont.eot +0 -0
  19. data/vendor/assets/stylesheets/bower_components/fontawesome/fonts/fontawesome-webfont.svg +53 -8
  20. data/vendor/assets/stylesheets/bower_components/fontawesome/fonts/fontawesome-webfont.ttf +0 -0
  21. data/vendor/assets/stylesheets/bower_components/fontawesome/fonts/fontawesome-webfont.woff +0 -0
  22. data/vendor/assets/stylesheets/bower_components/fontawesome/fonts/fontawesome-webfont.woff2 +0 -0
  23. data/vendor/assets/stylesheets/bower_components/fontawesome/less/{spinning.less → animated.less} +6 -1
  24. data/vendor/assets/stylesheets/bower_components/fontawesome/less/core.less +3 -1
  25. data/vendor/assets/stylesheets/bower_components/fontawesome/less/font-awesome.less +2 -2
  26. data/vendor/assets/stylesheets/bower_components/fontawesome/less/icons.less +45 -1
  27. data/vendor/assets/stylesheets/bower_components/fontawesome/less/mixins.less +3 -1
  28. data/vendor/assets/stylesheets/bower_components/fontawesome/less/path.less +1 -0
  29. data/vendor/assets/stylesheets/bower_components/fontawesome/less/variables.less +47 -2
  30. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/{_spinning.scss → _animated.scss} +5 -0
  31. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/_core.scss +3 -1
  32. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/_icons.scss +45 -1
  33. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/_mixins.scss +3 -1
  34. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/_path.scss +2 -1
  35. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/_variables.scss +47 -2
  36. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/font-awesome.scss +2 -2
  37. data/vendor/assets/stylesheets/bower_components/foundation/.bower.json +5 -5
  38. data/vendor/assets/stylesheets/bower_components/foundation/bower.json +1 -1
  39. data/vendor/assets/stylesheets/bower_components/foundation/css/foundation.css +1855 -1667
  40. data/vendor/assets/stylesheets/bower_components/foundation/css/foundation.css.map +7 -0
  41. data/vendor/assets/stylesheets/bower_components/foundation/css/foundation.min.css +1 -0
  42. data/vendor/assets/stylesheets/bower_components/foundation/css/normalize.css +11 -12
  43. data/vendor/assets/stylesheets/bower_components/foundation/css/normalize.css.map +7 -0
  44. data/vendor/assets/stylesheets/bower_components/foundation/css/normalize.min.css +1 -0
  45. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.abide.js +156 -62
  46. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.accordion.js +35 -13
  47. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.alert.js +8 -8
  48. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.clearing.js +93 -65
  49. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.dropdown.js +203 -66
  50. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.equalizer.js +57 -27
  51. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.interchange.js +61 -46
  52. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.joyride.js +93 -78
  53. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.js +177 -77
  54. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.magellan.js +81 -55
  55. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.offcanvas.js +28 -28
  56. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.orbit.js +135 -131
  57. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.reveal.js +119 -65
  58. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.slider.js +113 -71
  59. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.tab.js +67 -35
  60. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.tooltip.js +76 -37
  61. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation/foundation.topbar.js +71 -58
  62. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation.js +1570 -919
  63. data/vendor/assets/stylesheets/bower_components/foundation/js/foundation.min.js +5 -4
  64. data/vendor/assets/stylesheets/bower_components/foundation/js/vendor/fastclick.js +8 -9
  65. data/vendor/assets/stylesheets/bower_components/foundation/js/vendor/jquery.js +10 -9
  66. data/vendor/assets/stylesheets/bower_components/foundation/js/vendor/modernizr.js +1 -1
  67. data/vendor/assets/stylesheets/bower_components/foundation/js/vendor/placeholder.js +2 -2
  68. data/vendor/assets/stylesheets/bower_components/foundation/package.json +53 -0
  69. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/_functions.scss +76 -22
  70. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/_settings.scss +152 -107
  71. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_accordion.scss +8 -8
  72. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +12 -12
  73. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_block-grid.scss +14 -13
  74. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +18 -19
  75. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_button-groups.scss +35 -25
  76. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_buttons.scss +16 -19
  77. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_clearing.scss +60 -47
  78. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +15 -15
  79. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_dropdown.scss +42 -36
  80. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_flex-video.scss +7 -7
  81. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_forms.scss +103 -79
  82. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_global.scss +95 -53
  83. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_grid.scss +42 -25
  84. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_icon-bar.scss +371 -204
  85. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_inline-lists.scss +8 -8
  86. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_joyride.scss +40 -42
  87. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_keystrokes.scss +2 -3
  88. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_labels.scss +7 -7
  89. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_magellan.scss +2 -2
  90. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_offcanvas.scss +184 -179
  91. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_orbit.scss +90 -70
  92. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_pagination.scss +15 -15
  93. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_panels.scss +27 -15
  94. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +16 -16
  95. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_progress-bars.scss +4 -4
  96. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_range-slider.scss +28 -19
  97. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_reveal.scss +37 -50
  98. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_side-nav.scss +15 -11
  99. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_split-buttons.scss +26 -14
  100. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_sub-nav.scss +14 -12
  101. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_switches.scss +32 -21
  102. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_tables.scss +8 -8
  103. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_tabs.scss +50 -31
  104. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_thumbs.scss +8 -8
  105. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_tooltips.scss +25 -25
  106. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_top-bar.scss +197 -145
  107. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_type.scss +20 -81
  108. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_visibility.scss +99 -15
  109. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation.scss +37 -38
  110. data/vendor/assets/stylesheets/bower_components/foundation/scss/normalize.scss +8 -11
  111. data/vendor/assets/stylesheets/bower_components/jquery/.bower.json +5 -4
  112. data/vendor/assets/stylesheets/bower_components/jquery/bower.json +2 -1
  113. data/vendor/assets/stylesheets/bower_components/jquery/dist/jquery.js +9 -4
  114. data/vendor/assets/stylesheets/bower_components/jquery/dist/jquery.min.js +4 -4
  115. data/vendor/assets/stylesheets/bower_components/jquery/dist/jquery.min.map +1 -1
  116. data/vendor/assets/stylesheets/bower_components/jquery/src/core.js +6 -1
  117. data/vendor/assets/stylesheets/circle.yml +17 -0
  118. data/vendor/assets/stylesheets/components/_button.scss +120 -21
  119. data/vendor/assets/stylesheets/components/_dropdown.scss +316 -14
  120. data/vendor/assets/stylesheets/components/_flip-panel.scss +191 -0
  121. data/vendor/assets/stylesheets/components/_form.scss +346 -0
  122. data/vendor/assets/stylesheets/components/_layout.scss +261 -121
  123. data/vendor/assets/stylesheets/components/_panel.scss +91 -0
  124. data/vendor/assets/stylesheets/components/_quick-jump.scss +267 -0
  125. data/vendor/assets/stylesheets/components/_side-panel.scss +154 -0
  126. data/vendor/assets/stylesheets/components/_table.scss +105 -0
  127. data/vendor/assets/stylesheets/components/_typography.scss +34 -3
  128. data/vendor/assets/stylesheets/components/_vertical-align.scss +9 -0
  129. data/vendor/assets/stylesheets/globals/_functions.scss +69 -0
  130. data/vendor/assets/stylesheets/globals/_mixins.scss +23 -1
  131. data/vendor/assets/stylesheets/globals/_settings.scss +35 -36
  132. data/vendor/assets/stylesheets/paint.scss +22 -14
  133. metadata +29 -8
  134. data/vendor/assets/stylesheets/bower_components/fontawesome/less/extras.less +0 -2
  135. data/vendor/assets/stylesheets/bower_components/fontawesome/scss/_extras.scss +0 -44
  136. data/vendor/assets/stylesheets/bower_components/foundation/scss/foundation/components/_toolbar.scss +0 -70
@@ -14,7 +14,7 @@
14
14
  var head = $('head');
15
15
 
16
16
  while (i--) {
17
- if(head.has('.' + class_array[i]).length === 0) {
17
+ if (head.has('.' + class_array[i]).length === 0) {
18
18
  head.append('<meta class="' + class_array[i] + '" />');
19
19
  }
20
20
  }
@@ -22,15 +22,19 @@
22
22
 
23
23
  header_helpers([
24
24
  'foundation-mq-small',
25
+ 'foundation-mq-small-only',
25
26
  'foundation-mq-medium',
27
+ 'foundation-mq-medium-only',
26
28
  'foundation-mq-large',
29
+ 'foundation-mq-large-only',
27
30
  'foundation-mq-xlarge',
31
+ 'foundation-mq-xlarge-only',
28
32
  'foundation-mq-xxlarge',
29
33
  'foundation-data-attribute-namespace']);
30
34
 
31
35
  // Enable FastClick if present
32
36
 
33
- $(function() {
37
+ $(function () {
34
38
  if (typeof FastClick !== 'undefined') {
35
39
  // Don't attach to body if undefined
36
40
  if (typeof document.body !== 'undefined') {
@@ -48,7 +52,9 @@
48
52
  var cont;
49
53
  if (context.jquery) {
50
54
  cont = context[0];
51
- if (!cont) return context;
55
+ if (!cont) {
56
+ return context;
57
+ }
52
58
  } else {
53
59
  cont = context;
54
60
  }
@@ -65,8 +71,12 @@
65
71
 
66
72
  var attr_name = function (init) {
67
73
  var arr = [];
68
- if (!init) arr.push('data');
69
- if (this.namespace.length > 0) arr.push(this.namespace);
74
+ if (!init) {
75
+ arr.push('data');
76
+ }
77
+ if (this.namespace.length > 0) {
78
+ arr.push(this.namespace);
79
+ }
70
80
  arr.push(this.name);
71
81
 
72
82
  return arr.join('-');
@@ -96,25 +106,20 @@
96
106
 
97
107
  var bindings = function (method, options) {
98
108
  var self = this,
99
- should_bind_events = !S(this).data(this.attr_name(true));
109
+ bind = function(){
110
+ var $this = S(this),
111
+ should_bind_events = !$this.data(self.attr_name(true) + '-init');
112
+ $this.data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options($this)));
100
113
 
114
+ if (should_bind_events) {
115
+ self.events(this);
116
+ }
117
+ };
101
118
 
102
119
  if (S(this.scope).is('[' + this.attr_name() +']')) {
103
- S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope))));
104
-
105
- if (should_bind_events) {
106
- this.events(this.scope);
107
- }
108
-
120
+ bind.call(this.scope);
109
121
  } else {
110
- S('[' + this.attr_name() +']', this.scope).each(function () {
111
- var should_bind_events = !S(this).data(self.attr_name(true) + '-init');
112
- S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this))));
113
-
114
- if (should_bind_events) {
115
- self.events(this);
116
- }
117
- });
122
+ S('[' + this.attr_name() +']', this.scope).each(bind);
118
123
  }
119
124
  // # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating.
120
125
  if (typeof method === 'string') {
@@ -152,42 +157,52 @@
152
157
  }
153
158
  };
154
159
 
155
- /*
156
- https://github.com/paulirish/matchMedia.js
157
- */
160
+ /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
158
161
 
159
- window.matchMedia = window.matchMedia || (function( doc ) {
162
+ window.matchMedia || (window.matchMedia = function() {
163
+ "use strict";
160
164
 
161
- "use strict";
165
+ // For browsers that support matchMedium api such as IE 9 and webkit
166
+ var styleMedia = (window.styleMedia || window.media);
162
167
 
163
- var bool,
164
- docElem = doc.documentElement,
165
- refNode = docElem.firstElementChild || docElem.firstChild,
166
- // fakeBody required for <FF4 when executed in <head>
167
- fakeBody = doc.createElement( "body" ),
168
- div = doc.createElement( "div" );
168
+ // For those that don't support matchMedium
169
+ if (!styleMedia) {
170
+ var style = document.createElement('style'),
171
+ script = document.getElementsByTagName('script')[0],
172
+ info = null;
169
173
 
170
- div.id = "mq-test-1";
171
- div.style.cssText = "position:absolute;top:-100em";
172
- fakeBody.style.background = "none";
173
- fakeBody.appendChild(div);
174
+ style.type = 'text/css';
175
+ style.id = 'matchmediajs-test';
174
176
 
175
- return function (q) {
177
+ script.parentNode.insertBefore(style, script);
176
178
 
177
- div.innerHTML = "&shy;<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
179
+ // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
180
+ info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
178
181
 
179
- docElem.insertBefore( fakeBody, refNode );
180
- bool = div.offsetWidth === 42;
181
- docElem.removeChild( fakeBody );
182
+ styleMedia = {
183
+ matchMedium: function(media) {
184
+ var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
182
185
 
183
- return {
184
- matches: bool,
185
- media: q
186
- };
186
+ // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
187
+ if (style.styleSheet) {
188
+ style.styleSheet.cssText = text;
189
+ } else {
190
+ style.textContent = text;
191
+ }
187
192
 
188
- };
193
+ // Test if media query is true or false
194
+ return info.width === '1px';
195
+ }
196
+ };
197
+ }
189
198
 
190
- }( document ));
199
+ return function(media) {
200
+ return {
201
+ matches: styleMedia.matchMedium(media || 'all'),
202
+ media: media || 'all'
203
+ };
204
+ };
205
+ }());
191
206
 
192
207
  /*
193
208
  * jquery.requestAnimationFrame
@@ -198,7 +213,8 @@
198
213
  * Licensed under the MIT license.
199
214
  */
200
215
 
201
- (function($) {
216
+ (function(jQuery) {
217
+
202
218
 
203
219
  // requestAnimationFrame polyfill adapted from Erik Möller
204
220
  // fixes from Paul Irish and Tino Zijdel
@@ -213,10 +229,10 @@
213
229
  jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
214
230
 
215
231
  for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
216
- requestAnimationFrame = window[ vendors[lastTime] + "RequestAnimationFrame" ];
232
+ requestAnimationFrame = window[ vendors[lastTime] + 'RequestAnimationFrame' ];
217
233
  cancelAnimationFrame = cancelAnimationFrame ||
218
- window[ vendors[lastTime] + "CancelAnimationFrame" ] ||
219
- window[ vendors[lastTime] + "CancelRequestAnimationFrame" ];
234
+ window[ vendors[lastTime] + 'CancelAnimationFrame' ] ||
235
+ window[ vendors[lastTime] + 'CancelRequestAnimationFrame' ];
220
236
  }
221
237
 
222
238
  function raf() {
@@ -264,8 +280,7 @@
264
280
 
265
281
  }
266
282
 
267
- }( jQuery ));
268
-
283
+ }( $ ));
269
284
 
270
285
  function removeQuotes (string) {
271
286
  if (typeof string === 'string' || string instanceof String) {
@@ -278,20 +293,24 @@
278
293
  window.Foundation = {
279
294
  name : 'Foundation',
280
295
 
281
- version : '5.4.7',
296
+ version : '5.5.2',
282
297
 
283
298
  media_queries : {
284
- small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
285
- medium : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
286
- large : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
287
- xlarge: S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
288
- xxlarge: S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
299
+ 'small' : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
300
+ 'small-only' : S('.foundation-mq-small-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
301
+ 'medium' : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
302
+ 'medium-only' : S('.foundation-mq-medium-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
303
+ 'large' : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
304
+ 'large-only' : S('.foundation-mq-large-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
305
+ 'xlarge' : S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
306
+ 'xlarge-only' : S('.foundation-mq-xlarge-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
307
+ 'xxlarge' : S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
289
308
  },
290
309
 
291
310
  stylesheet : $('<style></style>').appendTo('head')[0].sheet,
292
311
 
293
- global: {
294
- namespace: undefined
312
+ global : {
313
+ namespace : undefined
295
314
  },
296
315
 
297
316
  init : function (scope, libraries, method, options, response) {
@@ -316,7 +335,7 @@
316
335
  }
317
336
  }
318
337
 
319
- S(window).load(function(){
338
+ S(window).load(function () {
320
339
  S(window)
321
340
  .trigger('resize.fndtn.clearing')
322
341
  .trigger('resize.fndtn.dropdown')
@@ -337,15 +356,14 @@
337
356
 
338
357
  if (args && args.hasOwnProperty(lib)) {
339
358
  if (typeof this.libs[lib].settings !== 'undefined') {
340
- $.extend(true, this.libs[lib].settings, args[lib]);
341
- }
342
- else if (typeof this.libs[lib].defaults !== 'undefined') {
343
- $.extend(true, this.libs[lib].defaults, args[lib]);
359
+ $.extend(true, this.libs[lib].settings, args[lib]);
360
+ } else if (typeof this.libs[lib].defaults !== 'undefined') {
361
+ $.extend(true, this.libs[lib].defaults, args[lib]);
344
362
  }
345
363
  return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
346
364
  }
347
365
 
348
- args = args instanceof Array ? args : new Array(args); // PATCH: added this line
366
+ args = args instanceof Array ? args : new Array(args);
349
367
  return this.libs[lib].init.apply(this.libs[lib], args);
350
368
  }
351
369
 
@@ -374,7 +392,7 @@
374
392
  }
375
393
  },
376
394
 
377
- set_namespace: function () {
395
+ set_namespace : function () {
378
396
 
379
397
  // Description:
380
398
  // Don't bother reading the namespace out of the meta tag
@@ -462,12 +480,16 @@
462
480
  var context = this, args = arguments;
463
481
  var later = function () {
464
482
  timeout = null;
465
- if (!immediate) result = func.apply(context, args);
483
+ if (!immediate) {
484
+ result = func.apply(context, args);
485
+ }
466
486
  };
467
487
  var callNow = immediate && !timeout;
468
488
  clearTimeout(timeout);
469
489
  timeout = setTimeout(later, delay);
470
- if (callNow) result = func.apply(context, args);
490
+ if (callNow) {
491
+ result = func.apply(context, args);
492
+ }
471
493
  return result;
472
494
  };
473
495
  },
@@ -504,11 +526,13 @@
504
526
  ii = opts_arr.length;
505
527
 
506
528
  function isNumber (o) {
507
- return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
529
+ return !isNaN (o - 0) && o !== null && o !== '' && o !== false && o !== true;
508
530
  }
509
531
 
510
532
  function trim (str) {
511
- if (typeof str === 'string') return $.trim(str);
533
+ if (typeof str === 'string') {
534
+ return $.trim(str);
535
+ }
512
536
  return str;
513
537
  }
514
538
 
@@ -516,8 +540,12 @@
516
540
  p = opts_arr[ii].split(':');
517
541
  p = [p[0], p.slice(1).join(':')];
518
542
 
519
- if (/true/i.test(p[1])) p[1] = true;
520
- if (/false/i.test(p[1])) p[1] = false;
543
+ if (/true/i.test(p[1])) {
544
+ p[1] = true;
545
+ }
546
+ if (/false/i.test(p[1])) {
547
+ p[1] = false;
548
+ }
521
549
  if (isNumber(p[1])) {
522
550
  if (p[1].indexOf('.') === -1) {
523
551
  p[1] = parseInt(p[1], 10);
@@ -543,7 +571,7 @@
543
571
  //
544
572
  // Class (String): Class name for the generated <meta> tag
545
573
  register_media : function (media, media_class) {
546
- if(Foundation.media_queries[media] === undefined) {
574
+ if (Foundation.media_queries[media] === undefined) {
547
575
  $('head').append('<meta class="' + media_class + '"/>');
548
576
  Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
549
577
  }
@@ -565,7 +593,7 @@
565
593
 
566
594
  if (query !== undefined) {
567
595
  Foundation.stylesheet.insertRule('@media ' +
568
- Foundation.media_queries[media] + '{ ' + rule + ' }');
596
+ Foundation.media_queries[media] + '{ ' + rule + ' }', Foundation.stylesheet.cssRules.length);
569
597
  }
570
598
  }
571
599
  },
@@ -581,7 +609,19 @@
581
609
  var self = this,
582
610
  unloaded = images.length;
583
611
 
584
- if (unloaded === 0) {
612
+ function pictures_has_height(images) {
613
+ var pictures_number = images.length;
614
+
615
+ for (var i = pictures_number - 1; i >= 0; i--) {
616
+ if(images.attr('height') === undefined) {
617
+ return false;
618
+ };
619
+ };
620
+
621
+ return true;
622
+ }
623
+
624
+ if (unloaded === 0 || pictures_has_height(images)) {
585
625
  callback(images);
586
626
  }
587
627
 
@@ -605,10 +645,70 @@
605
645
  // Returns:
606
646
  // Rand (String): Pseudo-random, alphanumeric string.
607
647
  random_str : function () {
608
- if (!this.fidx) this.fidx = 0;
648
+ if (!this.fidx) {
649
+ this.fidx = 0;
650
+ }
609
651
  this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
610
652
 
611
653
  return this.prefix + (this.fidx++).toString(36);
654
+ },
655
+
656
+ // Description:
657
+ // Helper for window.matchMedia
658
+ //
659
+ // Arguments:
660
+ // mq (String): Media query
661
+ //
662
+ // Returns:
663
+ // (Boolean): Whether the media query passes or not
664
+ match : function (mq) {
665
+ return window.matchMedia(mq).matches;
666
+ },
667
+
668
+ // Description:
669
+ // Helpers for checking Foundation default media queries with JS
670
+ //
671
+ // Returns:
672
+ // (Boolean): Whether the media query passes or not
673
+
674
+ is_small_up : function () {
675
+ return this.match(Foundation.media_queries.small);
676
+ },
677
+
678
+ is_medium_up : function () {
679
+ return this.match(Foundation.media_queries.medium);
680
+ },
681
+
682
+ is_large_up : function () {
683
+ return this.match(Foundation.media_queries.large);
684
+ },
685
+
686
+ is_xlarge_up : function () {
687
+ return this.match(Foundation.media_queries.xlarge);
688
+ },
689
+
690
+ is_xxlarge_up : function () {
691
+ return this.match(Foundation.media_queries.xxlarge);
692
+ },
693
+
694
+ is_small_only : function () {
695
+ return !this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
696
+ },
697
+
698
+ is_medium_only : function () {
699
+ return this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
700
+ },
701
+
702
+ is_large_only : function () {
703
+ return this.is_medium_up() && this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
704
+ },
705
+
706
+ is_xlarge_only : function () {
707
+ return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && !this.is_xxlarge_up();
708
+ },
709
+
710
+ is_xxlarge_only : function () {
711
+ return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && this.is_xxlarge_up();
612
712
  }
613
713
  }
614
714
  };
@@ -630,19 +730,21 @@
630
730
  Foundation.libs.abide = {
631
731
  name : 'abide',
632
732
 
633
- version : '5.4.7',
733
+ version : '5.5.2',
634
734
 
635
735
  settings : {
636
736
  live_validate : true,
737
+ validate_on_blur : true,
738
+ // validate_on: 'tab', // tab (when user tabs between fields), change (input changes), manual (call custom events)
637
739
  focus_on_invalid : true,
638
- error_labels: true, // labels with a for="inputId" will recieve an `error` class
639
- error_class: 'error',
740
+ error_labels : true, // labels with a for="inputId" will recieve an `error` class
741
+ error_class : 'error',
640
742
  timeout : 1000,
641
743
  patterns : {
642
- alpha: /^[a-zA-Z]+$/,
744
+ alpha : /^[a-zA-Z]+$/,
643
745
  alpha_numeric : /^[a-zA-Z0-9]+$/,
644
- integer: /^[-+]?\d+$/,
645
- number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
746
+ integer : /^[-+]?\d+$/,
747
+ number : /^[-+]?\d*(?:[\.\,]\d+)?$/,
646
748
 
647
749
  // amex, visa, diners
648
750
  card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
@@ -651,26 +753,27 @@
651
753
  // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
652
754
  email : /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
653
755
 
654
- url: /^(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,
756
+ // http://blogs.lse.ac.uk/lti/2008/04/23/a-regular-expression-to-match-any-url/
757
+ url: /^(https?|ftp|file|ssh):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+~%\/\.\w]+)?\??([-\+=&;%@\.\w]+)?#?([\w]+)?)?/,
655
758
  // abc.de
656
- domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/,
759
+ domain : /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
657
760
 
658
- datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
761
+ datetime : /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
659
762
  // YYYY-MM-DD
660
- date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
763
+ date : /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
661
764
  // HH:MM:SS
662
765
  time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
663
- dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
766
+ dateISO : /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
664
767
  // MM/DD/YYYY
665
768
  month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
666
769
  // DD/MM/YYYY
667
770
  day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
668
771
 
669
772
  // #FFF or #FFFFFF
670
- color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
773
+ color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
671
774
  },
672
775
  validators : {
673
- equalTo: function(el, required, parent) {
776
+ equalTo : function (el, required, parent) {
674
777
  var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
675
778
  to = el.value,
676
779
  valid = (from === to);
@@ -693,34 +796,71 @@
693
796
 
694
797
  this.invalid_attr = this.add_namespace('data-invalid');
695
798
 
799
+ function validate(originalSelf, e) {
800
+ clearTimeout(self.timer);
801
+ self.timer = setTimeout(function () {
802
+ self.validate([originalSelf], e);
803
+ }.bind(originalSelf), settings.timeout);
804
+ }
805
+
806
+
696
807
  form
697
808
  .off('.abide')
698
- .on('submit.fndtn.abide validate.fndtn.abide', function (e) {
809
+ .on('submit.fndtn.abide', function (e) {
699
810
  var is_ajax = /ajax/i.test(self.S(this).attr(self.attr_name()));
700
- return self.validate(self.S(this).find('input, textarea, select').get(), e, is_ajax);
811
+ return self.validate(self.S(this).find('input, textarea, select').not(":hidden, [data-abide-ignore]").get(), e, is_ajax);
701
812
  })
702
- .on('reset', function() {
703
- return self.reset($(this));
813
+ .on('validate.fndtn.abide', function (e) {
814
+ if (settings.validate_on === 'manual') {
815
+ self.validate([e.target], e);
816
+ }
817
+ })
818
+ .on('reset', function (e) {
819
+ return self.reset($(this), e);
704
820
  })
705
- .find('input, textarea, select')
821
+ .find('input, textarea, select').not(":hidden, [data-abide-ignore]")
706
822
  .off('.abide')
707
823
  .on('blur.fndtn.abide change.fndtn.abide', function (e) {
708
- self.validate([this], e);
824
+ // old settings fallback
825
+ // will be deprecated with F6 release
826
+ if (settings.validate_on_blur && settings.validate_on_blur === true) {
827
+ validate(this, e);
828
+ }
829
+ // new settings combining validate options into one setting
830
+ if (settings.validate_on === 'change') {
831
+ validate(this, e);
832
+ }
709
833
  })
710
834
  .on('keydown.fndtn.abide', function (e) {
711
- if (settings.live_validate === true) {
712
- clearTimeout(self.timer);
713
- self.timer = setTimeout(function () {
714
- self.validate([this], e);
715
- }.bind(this), settings.timeout);
835
+ // old settings fallback
836
+ // will be deprecated with F6 release
837
+ if (settings.live_validate && settings.live_validate === true && e.which != 9) {
838
+ validate(this, e);
839
+ }
840
+ // new settings combining validate options into one setting
841
+ if (settings.validate_on === 'tab' && e.which === 9) {
842
+ validate(this, e);
843
+ }
844
+ else if (settings.validate_on === 'change') {
845
+ validate(this, e);
716
846
  }
847
+ })
848
+ .on('focus', function (e) {
849
+ if (navigator.userAgent.match(/iPad|iPhone|Android|BlackBerry|Windows Phone|webOS/i)) {
850
+ $('html, body').animate({
851
+ scrollTop: $(e.target).offset().top
852
+ }, 100);
853
+ }
717
854
  });
718
855
  },
719
856
 
720
- reset : function (form) {
721
- form.removeAttr(this.invalid_attr);
722
- $(this.invalid_attr, form).removeAttr(this.invalid_attr);
723
- $('.' + this.settings.error_class, form).not('small').removeClass(this.settings.error_class);
857
+ reset : function (form, e) {
858
+ var self = this;
859
+ form.removeAttr(self.invalid_attr);
860
+
861
+ $('[' + self.invalid_attr + ']', form).removeAttr(self.invalid_attr);
862
+ $('.' + self.settings.error_class, form).not('small').removeClass(self.settings.error_class);
863
+ $(':input', form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr(self.invalid_attr);
724
864
  },
725
865
 
726
866
  validate : function (els, e, is_ajax) {
@@ -730,22 +870,26 @@
730
870
  submit_event = /submit/.test(e.type);
731
871
 
732
872
  // Has to count up to make sure the focus gets applied to the top error
733
- for (var i=0; i < validation_count; i++) {
873
+ for (var i = 0; i < validation_count; i++) {
734
874
  if (!validations[i] && (submit_event || is_ajax)) {
735
- if (this.settings.focus_on_invalid) els[i].focus();
736
- form.trigger('invalid');
875
+ if (this.settings.focus_on_invalid) {
876
+ els[i].focus();
877
+ }
878
+ form.trigger('invalid.fndtn.abide');
737
879
  this.S(els[i]).closest('form').attr(this.invalid_attr, '');
738
880
  return false;
739
881
  }
740
882
  }
741
883
 
742
884
  if (submit_event || is_ajax) {
743
- form.trigger('valid');
885
+ form.trigger('valid.fndtn.abide');
744
886
  }
745
887
 
746
888
  form.removeAttr(this.invalid_attr);
747
889
 
748
- if (is_ajax) return false;
890
+ if (is_ajax) {
891
+ return false;
892
+ }
749
893
 
750
894
  return true;
751
895
  },
@@ -782,6 +926,7 @@
782
926
  return [el, pattern, required];
783
927
  },
784
928
 
929
+ // TODO: Break this up into smaller methods, getting hard to read.
785
930
  check_validation_and_apply_styles : function (el_patterns) {
786
931
  var i = el_patterns.length,
787
932
  validations = [],
@@ -793,8 +938,8 @@
793
938
  value = el.value.trim(),
794
939
  direct_parent = this.S(el).parent(),
795
940
  validator = el.getAttribute(this.add_namespace('data-abide-validator')),
796
- is_radio = el.type === "radio",
797
- is_checkbox = el.type === "checkbox",
941
+ is_radio = el.type === 'radio',
942
+ is_checkbox = el.type === 'checkbox',
798
943
  label = this.S('label[for="' + el.getAttribute('id') + '"]'),
799
944
  valid_length = (required) ? (el.value.length > 0) : true,
800
945
  el_validations = [];
@@ -802,7 +947,7 @@
802
947
  var parent, valid;
803
948
 
804
949
  // support old way to do equalTo validations
805
- if(el.getAttribute(this.add_namespace('data-equalto'))) { validator = "equalTo" }
950
+ if (el.getAttribute(this.add_namespace('data-equalto'))) { validator = 'equalTo' }
806
951
 
807
952
  if (!direct_parent.is('label')) {
808
953
  parent = direct_parent;
@@ -810,15 +955,36 @@
810
955
  parent = direct_parent.parent();
811
956
  }
812
957
 
813
- if (validator) {
814
- valid = this.settings.validators[validator].apply(this, [el, required, parent]);
815
- el_validations.push(valid);
816
- }
817
-
818
958
  if (is_radio && required) {
819
959
  el_validations.push(this.valid_radio(el, required));
820
960
  } else if (is_checkbox && required) {
821
961
  el_validations.push(this.valid_checkbox(el, required));
962
+
963
+ } else if (validator) {
964
+ // Validate using each of the specified (space-delimited) validators.
965
+ var validators = validator.split(' ');
966
+ var last_valid = true, all_valid = true;
967
+ for (var iv = 0; iv < validators.length; iv++) {
968
+ valid = this.settings.validators[validators[iv]].apply(this, [el, required, parent])
969
+ el_validations.push(valid);
970
+ all_valid = valid && last_valid;
971
+ last_valid = valid;
972
+ }
973
+ if (all_valid) {
974
+ this.S(el).removeAttr(this.invalid_attr);
975
+ parent.removeClass('error');
976
+ if (label.length > 0 && this.settings.error_labels) {
977
+ label.removeClass(this.settings.error_class).removeAttr('role');
978
+ }
979
+ $(el).triggerHandler('valid');
980
+ } else {
981
+ this.S(el).attr(this.invalid_attr, '');
982
+ parent.addClass('error');
983
+ if (label.length > 0 && this.settings.error_labels) {
984
+ label.addClass(this.settings.error_class).attr('role', 'alert');
985
+ }
986
+ $(el).triggerHandler('invalid');
987
+ }
822
988
  } else {
823
989
 
824
990
  if (el_patterns[i][1].test(value) && valid_length ||
@@ -828,9 +994,8 @@
828
994
  el_validations.push(false);
829
995
  }
830
996
 
831
- el_validations = [el_validations.every(function(valid){return valid;})];
832
-
833
- if(el_validations[0]){
997
+ el_validations = [el_validations.every(function (valid) {return valid;})];
998
+ if (el_validations[0]) {
834
999
  this.S(el).removeAttr(this.invalid_attr);
835
1000
  el.setAttribute('aria-invalid', 'false');
836
1001
  el.removeAttribute('aria-describedby');
@@ -844,9 +1009,11 @@
844
1009
  el.setAttribute('aria-invalid', 'true');
845
1010
 
846
1011
  // Try to find the error associated with the input
847
- var errorElem = parent.find('small.'+this.settings.error_class, 'span.'+this.settings.error_class);
848
- var errorID = errorElem.length > 0 ? errorElem[0].id : "";
849
- if (errorID.length > 0) el.setAttribute('aria-describedby', errorID);
1012
+ var errorElem = parent.find('small.' + this.settings.error_class, 'span.' + this.settings.error_class);
1013
+ var errorID = errorElem.length > 0 ? errorElem[0].id : '';
1014
+ if (errorID.length > 0) {
1015
+ el.setAttribute('aria-describedby', errorID);
1016
+ }
850
1017
 
851
1018
  // el.setAttribute('aria-describedby', $(el).find('.error')[0].id);
852
1019
  parent.addClass(this.settings.error_class);
@@ -856,20 +1023,21 @@
856
1023
  $(el).triggerHandler('invalid');
857
1024
  }
858
1025
  }
859
- validations.push(el_validations[0]);
1026
+ validations = validations.concat(el_validations);
860
1027
  }
861
- validations = [validations.every(function(valid){return valid;})];
862
1028
  return validations;
863
1029
  },
864
1030
 
865
- valid_checkbox : function(el, required) {
1031
+ valid_checkbox : function (el, required) {
866
1032
  var el = this.S(el),
867
- valid = (el.is(':checked') || !required);
1033
+ valid = (el.is(':checked') || !required || el.get(0).getAttribute('disabled'));
868
1034
 
869
1035
  if (valid) {
870
1036
  el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
1037
+ $(el).triggerHandler('valid');
871
1038
  } else {
872
1039
  el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
1040
+ $(el).triggerHandler('invalid');
873
1041
  }
874
1042
 
875
1043
  return valid;
@@ -877,28 +1045,42 @@
877
1045
 
878
1046
  valid_radio : function (el, required) {
879
1047
  var name = el.getAttribute('name'),
880
- group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='"+name+"']"),
1048
+ group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='" + name + "']"),
881
1049
  count = group.length,
882
- valid = false;
1050
+ valid = false,
1051
+ disabled = false;
883
1052
 
884
1053
  // Has to count up to make sure the focus gets applied to the top error
885
- for (var i=0; i < count; i++) {
886
- if (group[i].checked) valid = true;
887
- }
1054
+ for (var i=0; i < count; i++) {
1055
+ if( group[i].getAttribute('disabled') ){
1056
+ disabled=true;
1057
+ valid=true;
1058
+ } else {
1059
+ if (group[i].checked){
1060
+ valid = true;
1061
+ } else {
1062
+ if( disabled ){
1063
+ valid = false;
1064
+ }
1065
+ }
1066
+ }
1067
+ }
888
1068
 
889
1069
  // Has to count up to make sure the focus gets applied to the top error
890
- for (var i=0; i < count; i++) {
1070
+ for (var i = 0; i < count; i++) {
891
1071
  if (valid) {
892
1072
  this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
1073
+ $(group[i]).triggerHandler('valid');
893
1074
  } else {
894
1075
  this.S(group[i]).attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
1076
+ $(group[i]).triggerHandler('invalid');
895
1077
  }
896
1078
  }
897
1079
 
898
1080
  return valid;
899
1081
  },
900
1082
 
901
- valid_equal: function(el, required, parent) {
1083
+ valid_equal : function (el, required, parent) {
902
1084
  var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
903
1085
  to = el.value,
904
1086
  valid = (from === to);
@@ -906,17 +1088,21 @@
906
1088
  if (valid) {
907
1089
  this.S(el).removeAttr(this.invalid_attr);
908
1090
  parent.removeClass(this.settings.error_class);
909
- if (label.length > 0 && settings.error_labels) label.removeClass(this.settings.error_class);
1091
+ if (label.length > 0 && settings.error_labels) {
1092
+ label.removeClass(this.settings.error_class);
1093
+ }
910
1094
  } else {
911
1095
  this.S(el).attr(this.invalid_attr, '');
912
1096
  parent.addClass(this.settings.error_class);
913
- if (label.length > 0 && settings.error_labels) label.addClass(this.settings.error_class);
1097
+ if (label.length > 0 && settings.error_labels) {
1098
+ label.addClass(this.settings.error_class);
1099
+ }
914
1100
  }
915
1101
 
916
1102
  return valid;
917
1103
  },
918
1104
 
919
- valid_oneof: function(el, required, parent, doNotValidateOthers) {
1105
+ valid_oneof : function (el, required, parent, doNotValidateOthers) {
920
1106
  var el = this.S(el),
921
1107
  others = this.S('[' + this.add_namespace('data-oneof') + ']'),
922
1108
  valid = others.filter(':checked').length > 0;
@@ -929,12 +1115,20 @@
929
1115
 
930
1116
  if (!doNotValidateOthers) {
931
1117
  var _this = this;
932
- others.each(function() {
1118
+ others.each(function () {
933
1119
  _this.valid_oneof.call(_this, this, null, null, true);
934
1120
  });
935
1121
  }
936
1122
 
937
1123
  return valid;
1124
+ },
1125
+
1126
+ reflow : function(scope, options) {
1127
+ var self = this,
1128
+ form = self.S('[' + this.attr_name() + ']').attr('novalidate', 'novalidate');
1129
+ self.S(form).each(function (idx, el) {
1130
+ self.events(el);
1131
+ });
938
1132
  }
939
1133
  };
940
1134
  }(jQuery, window, window.document));
@@ -945,13 +1139,13 @@
945
1139
  Foundation.libs.accordion = {
946
1140
  name : 'accordion',
947
1141
 
948
- version : '5.4.7',
1142
+ version : '5.5.2',
949
1143
 
950
1144
  settings : {
951
- content_class: 'content',
952
- active_class: 'active',
953
- multi_expand: false,
954
- toggleable: true,
1145
+ content_class : 'content',
1146
+ active_class : 'active',
1147
+ multi_expand : false,
1148
+ toggleable : true,
955
1149
  callback : function () {}
956
1150
  },
957
1151
 
@@ -959,29 +1153,35 @@
959
1153
  this.bindings(method, options);
960
1154
  },
961
1155
 
962
- events : function () {
1156
+ events : function (instance) {
963
1157
  var self = this;
964
1158
  var S = this.S;
1159
+ self.create(this.S(instance));
1160
+
965
1161
  S(this.scope)
966
1162
  .off('.fndtn.accordion')
967
- .on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a', function (e) {
1163
+ .on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' + this.attr_name() + '] > li > a', function (e) {
968
1164
  var accordion = S(this).closest('[' + self.attr_name() + ']'),
969
1165
  groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
970
- settings = accordion.data(self.attr_name(true) + '-init'),
1166
+ settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
971
1167
  target = S('#' + this.href.split('#')[1]),
972
- aunts = $('> dd', accordion),
973
- siblings = aunts.children('.'+settings.content_class),
1168
+ aunts = $('> dd, > li', accordion),
1169
+ siblings = aunts.children('.' + settings.content_class),
974
1170
  active_content = siblings.filter('.' + settings.active_class);
1171
+
975
1172
  e.preventDefault();
976
1173
 
977
1174
  if (accordion.attr(self.attr_name())) {
978
- siblings = siblings.add('[' + groupSelector + '] dd > .'+settings.content_class);
979
- aunts = aunts.add('[' + groupSelector + '] dd');
1175
+ siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class + ', [' + groupSelector + '] li > ' + '.' + settings.content_class);
1176
+ aunts = aunts.add('[' + groupSelector + '] dd, [' + groupSelector + '] li');
980
1177
  }
981
1178
 
982
1179
  if (settings.toggleable && target.is(active_content)) {
983
- target.parent('dd').toggleClass(settings.active_class, false);
1180
+ target.parent('dd, li').toggleClass(settings.active_class, false);
984
1181
  target.toggleClass(settings.active_class, false);
1182
+ S(this).attr('aria-expanded', function(i, attr){
1183
+ return attr === 'true' ? 'false' : 'true';
1184
+ });
985
1185
  settings.callback(target);
986
1186
  target.triggerHandler('toggled', [accordion]);
987
1187
  accordion.triggerHandler('toggled', [target]);
@@ -991,15 +1191,31 @@
991
1191
  if (!settings.multi_expand) {
992
1192
  siblings.removeClass(settings.active_class);
993
1193
  aunts.removeClass(settings.active_class);
1194
+ aunts.children('a').attr('aria-expanded','false');
994
1195
  }
995
1196
 
996
1197
  target.addClass(settings.active_class).parent().addClass(settings.active_class);
997
1198
  settings.callback(target);
998
1199
  target.triggerHandler('toggled', [accordion]);
999
1200
  accordion.triggerHandler('toggled', [target]);
1201
+ S(this).attr('aria-expanded','true');
1000
1202
  });
1001
1203
  },
1002
1204
 
1205
+ create: function($instance) {
1206
+ var self = this,
1207
+ accordion = $instance,
1208
+ aunts = $('> .accordion-navigation', accordion),
1209
+ settings = accordion.data(self.attr_name(true) + '-init') || self.settings;
1210
+
1211
+ aunts.children('a').attr('aria-expanded','false');
1212
+ aunts.has('.' + settings.content_class + '.' + settings.active_class).children('a').attr('aria-expanded','true');
1213
+
1214
+ if (settings.multi_expand) {
1215
+ $instance.attr('aria-multiselectable','true');
1216
+ }
1217
+ },
1218
+
1003
1219
  off : function () {},
1004
1220
 
1005
1221
  reflow : function () {}
@@ -1012,10 +1228,10 @@
1012
1228
  Foundation.libs.alert = {
1013
1229
  name : 'alert',
1014
1230
 
1015
- version : '5.4.7',
1231
+ version : '5.5.2',
1016
1232
 
1017
1233
  settings : {
1018
- callback: function (){}
1234
+ callback : function () {}
1019
1235
  },
1020
1236
 
1021
1237
  init : function (scope, method, options) {
@@ -1027,19 +1243,19 @@
1027
1243
  S = this.S;
1028
1244
 
1029
1245
  $(this.scope).off('.alert').on('click.fndtn.alert', '[' + this.attr_name() + '] .close', function (e) {
1030
- var alertBox = S(this).closest('[' + self.attr_name() + ']'),
1031
- settings = alertBox.data(self.attr_name(true) + '-init') || self.settings;
1246
+ var alertBox = S(this).closest('[' + self.attr_name() + ']'),
1247
+ settings = alertBox.data(self.attr_name(true) + '-init') || self.settings;
1032
1248
 
1033
1249
  e.preventDefault();
1034
1250
  if (Modernizr.csstransitions) {
1035
- alertBox.addClass("alert-close");
1036
- alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function(e) {
1037
- S(this).trigger('close').trigger('close.fndtn.alert').remove();
1251
+ alertBox.addClass('alert-close');
1252
+ alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function (e) {
1253
+ S(this).trigger('close.fndtn.alert').remove();
1038
1254
  settings.callback();
1039
1255
  });
1040
1256
  } else {
1041
1257
  alertBox.fadeOut(300, function () {
1042
- S(this).trigger('close').trigger('close.fndtn.alert').remove();
1258
+ S(this).trigger('close.fndtn.alert').remove();
1043
1259
  settings.callback();
1044
1260
  });
1045
1261
  }
@@ -1056,19 +1272,21 @@
1056
1272
  Foundation.libs.clearing = {
1057
1273
  name : 'clearing',
1058
1274
 
1059
- version: '5.4.7',
1275
+ version : '5.5.2',
1060
1276
 
1061
1277
  settings : {
1062
1278
  templates : {
1063
1279
  viewing : '<a href="#" class="clearing-close">&times;</a>' +
1064
1280
  '<div class="visible-img" style="display: none"><div class="clearing-touch-label"></div><img src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
1065
1281
  '<p class="clearing-caption"></p><a href="#" class="clearing-main-prev"><span></span></a>' +
1066
- '<a href="#" class="clearing-main-next"><span></span></a></div>'
1282
+ '<a href="#" class="clearing-main-next"><span></span></a></div>' +
1283
+ '<img class="clearing-preload-next" style="display: none" src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />' +
1284
+ '<img class="clearing-preload-prev" style="display: none" src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D" alt="" />'
1067
1285
  },
1068
1286
 
1069
1287
  // comma delimited list of selectors that, on click, will close clearing,
1070
1288
  // add 'div.clearing-blackout, div.visible-img' to close on background click
1071
- close_selectors : '.clearing-close, div.clearing-blackout',
1289
+ close_selectors : '.clearing-close, div.clearing-blackout',
1072
1290
 
1073
1291
  // Default to the entire li element.
1074
1292
  open_selectors : '',
@@ -1159,23 +1377,27 @@
1159
1377
  S = self.S;
1160
1378
 
1161
1379
  S(this.scope)
1162
- .on('touchstart.fndtn.clearing', '.visible-img', function(e) {
1380
+ .on('touchstart.fndtn.clearing', '.visible-img', function (e) {
1163
1381
  if (!e.touches) { e = e.originalEvent; }
1164
1382
  var data = {
1165
- start_page_x: e.touches[0].pageX,
1166
- start_page_y: e.touches[0].pageY,
1167
- start_time: (new Date()).getTime(),
1168
- delta_x: 0,
1169
- is_scrolling: undefined
1383
+ start_page_x : e.touches[0].pageX,
1384
+ start_page_y : e.touches[0].pageY,
1385
+ start_time : (new Date()).getTime(),
1386
+ delta_x : 0,
1387
+ is_scrolling : undefined
1170
1388
  };
1171
1389
 
1172
1390
  S(this).data('swipe-transition', data);
1173
1391
  e.stopPropagation();
1174
1392
  })
1175
- .on('touchmove.fndtn.clearing', '.visible-img', function(e) {
1176
- if (!e.touches) { e = e.originalEvent; }
1393
+ .on('touchmove.fndtn.clearing', '.visible-img', function (e) {
1394
+ if (!e.touches) {
1395
+ e = e.originalEvent;
1396
+ }
1177
1397
  // Ignore pinch/zoom events
1178
- if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
1398
+ if (e.touches.length > 1 || e.scale && e.scale !== 1) {
1399
+ return;
1400
+ }
1179
1401
 
1180
1402
  var data = S(this).data('swipe-transition');
1181
1403
 
@@ -1200,7 +1422,7 @@
1200
1422
  self.nav(e, direction);
1201
1423
  }
1202
1424
  })
1203
- .on('touchend.fndtn.clearing', '.visible-img', function(e) {
1425
+ .on('touchend.fndtn.clearing', '.visible-img', function (e) {
1204
1426
  S(this).data('swipe-transition', {});
1205
1427
  e.stopPropagation();
1206
1428
  });
@@ -1212,7 +1434,7 @@
1212
1434
  if ($el.parent().hasClass('carousel')) {
1213
1435
  return;
1214
1436
  }
1215
-
1437
+
1216
1438
  $el.after('<div id="foundationClearingHolder"></div>');
1217
1439
 
1218
1440
  var grid = $el.detach(),
@@ -1223,12 +1445,12 @@
1223
1445
  } else {
1224
1446
  grid_outerHTML = grid[0].outerHTML;
1225
1447
  }
1226
-
1448
+
1227
1449
  var holder = this.S('#foundationClearingHolder'),
1228
1450
  settings = $el.data(this.attr_name(true) + '-init'),
1229
1451
  data = {
1230
- grid: '<div class="carousel">' + grid_outerHTML + '</div>',
1231
- viewing: settings.templates.viewing
1452
+ grid : '<div class="carousel">' + grid_outerHTML + '</div>',
1453
+ viewing : settings.templates.viewing
1232
1454
  },
1233
1455
  wrapper = '<div class="clearing-assembled"><div>' + data.viewing +
1234
1456
  data.grid + '</div></div>',
@@ -1249,10 +1471,11 @@
1249
1471
  visible_image = self.S('.visible-img', container),
1250
1472
  image = self.S('img', visible_image).not($image),
1251
1473
  label = self.S('.clearing-touch-label', container),
1252
- error = false;
1474
+ error = false,
1475
+ loaded = {};
1253
1476
 
1254
1477
  // Event to disable scrolling on touch devices when Clearing is activated
1255
- $('body').on('touchmove',function(e){
1478
+ $('body').on('touchmove', function (e) {
1256
1479
  e.preventDefault();
1257
1480
  });
1258
1481
 
@@ -1275,6 +1498,7 @@
1275
1498
  function cb (image) {
1276
1499
  var $image = $(image);
1277
1500
  $image.css('visibility', 'visible');
1501
+ $image.trigger('imageVisible');
1278
1502
  // toggle the gallery
1279
1503
  body.css('overflow', 'hidden');
1280
1504
  root.addClass('clearing-blackout');
@@ -1293,9 +1517,17 @@
1293
1517
  if (!this.locked()) {
1294
1518
  visible_image.trigger('open.fndtn.clearing');
1295
1519
  // set the image to the selected thumbnail
1296
- image
1297
- .attr('src', this.load($image))
1298
- .css('visibility', 'hidden');
1520
+ loaded = this.load($image);
1521
+ if (loaded.interchange) {
1522
+ image
1523
+ .attr('data-interchange', loaded.interchange)
1524
+ .foundation('interchange', 'reflow');
1525
+ } else {
1526
+ image
1527
+ .attr('src', loaded.src)
1528
+ .attr('data-interchange', '');
1529
+ }
1530
+ image.css('visibility', 'hidden');
1299
1531
 
1300
1532
  startLoad.call(this);
1301
1533
  }
@@ -1324,7 +1556,7 @@
1324
1556
  .removeClass('clearing-blackout');
1325
1557
  container.removeClass('clearing-container');
1326
1558
  visible_image.hide();
1327
- visible_image.trigger('closed.fndtn.clearing');
1559
+ visible_image.trigger('closed.fndtn.clearing');
1328
1560
  }
1329
1561
 
1330
1562
  // Event to re-enable scrolling on touch devices
@@ -1343,9 +1575,15 @@
1343
1575
  PREV_KEY = this.rtl ? 39 : 37,
1344
1576
  ESC_KEY = 27;
1345
1577
 
1346
- if (e.which === NEXT_KEY) this.go(clearing, 'next');
1347
- if (e.which === PREV_KEY) this.go(clearing, 'prev');
1348
- if (e.which === ESC_KEY) this.S('a.clearing-close').trigger('click').trigger('click.fndtn.clearing');
1578
+ if (e.which === NEXT_KEY) {
1579
+ this.go(clearing, 'next');
1580
+ }
1581
+ if (e.which === PREV_KEY) {
1582
+ this.go(clearing, 'prev');
1583
+ }
1584
+ if (e.which === ESC_KEY) {
1585
+ this.S('a.clearing-close').trigger('click.fndtn.clearing');
1586
+ }
1349
1587
  },
1350
1588
 
1351
1589
  nav : function (e, direction) {
@@ -1404,34 +1642,18 @@
1404
1642
  },
1405
1643
 
1406
1644
  center_and_label : function (target, label) {
1407
- if (!this.rtl) {
1408
- target.css({
1409
- marginLeft : -(target.outerWidth() / 2),
1410
- marginTop : -(target.outerHeight() / 2)
1645
+ if (!this.rtl && label.length > 0) {
1646
+ label.css({
1647
+ marginLeft : -(label.outerWidth() / 2),
1648
+ marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10
1411
1649
  });
1412
-
1413
- if (label.length > 0) {
1414
- label.css({
1415
- marginLeft : -(label.outerWidth() / 2),
1416
- marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10
1417
- });
1418
- }
1419
1650
  } else {
1420
- target.css({
1421
- marginRight : -(target.outerWidth() / 2),
1422
- marginTop : -(target.outerHeight() / 2),
1651
+ label.css({
1652
+ marginRight : -(label.outerWidth() / 2),
1653
+ marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10,
1423
1654
  left: 'auto',
1424
1655
  right: '50%'
1425
1656
  });
1426
-
1427
- if (label.length > 0) {
1428
- label.css({
1429
- marginRight : -(label.outerWidth() / 2),
1430
- marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10,
1431
- left: 'auto',
1432
- right: '50%'
1433
- });
1434
- }
1435
1657
  }
1436
1658
  return this;
1437
1659
  },
@@ -1439,35 +1661,55 @@
1439
1661
  // image loading and preloading
1440
1662
 
1441
1663
  load : function ($image) {
1442
- var href;
1664
+ var href,
1665
+ interchange,
1666
+ closest_a;
1443
1667
 
1444
- if ($image[0].nodeName === "A") {
1668
+ if ($image[0].nodeName === 'A') {
1445
1669
  href = $image.attr('href');
1670
+ interchange = $image.data('clearing-interchange');
1446
1671
  } else {
1447
- href = $image.parent().attr('href');
1672
+ closest_a = $image.closest('a');
1673
+ href = closest_a.attr('href');
1674
+ interchange = closest_a.data('clearing-interchange');
1448
1675
  }
1449
1676
 
1450
1677
  this.preload($image);
1451
1678
 
1452
- if (href) return href;
1453
- return $image.attr('src');
1679
+ return {
1680
+ 'src': href ? href : $image.attr('src'),
1681
+ 'interchange': href ? interchange : $image.data('clearing-interchange')
1682
+ }
1454
1683
  },
1455
1684
 
1456
1685
  preload : function ($image) {
1457
1686
  this
1458
- .img($image.closest('li').next())
1459
- .img($image.closest('li').prev());
1687
+ .img($image.closest('li').next(), 'next')
1688
+ .img($image.closest('li').prev(), 'prev');
1460
1689
  },
1461
1690
 
1462
- img : function (img) {
1691
+ img : function (img, sibling_type) {
1463
1692
  if (img.length) {
1464
- var new_img = new Image(),
1465
- new_a = this.S('a', img);
1693
+ var preload_img = $('.clearing-preload-' + sibling_type),
1694
+ new_a = this.S('a', img),
1695
+ src,
1696
+ interchange,
1697
+ image;
1466
1698
 
1467
1699
  if (new_a.length) {
1468
- new_img.src = new_a.attr('href');
1700
+ src = new_a.attr('href');
1701
+ interchange = new_a.data('clearing-interchange');
1469
1702
  } else {
1470
- new_img.src = this.S('img', img).attr('src');
1703
+ image = this.S('img', img);
1704
+ src = image.attr('src');
1705
+ interchange = image.data('clearing-interchange');
1706
+ }
1707
+
1708
+ if (interchange) {
1709
+ preload_img.attr('data-interchange', interchange);
1710
+ } else {
1711
+ preload_img.attr('src', src);
1712
+ preload_img.attr('data-interchange', '');
1471
1713
  }
1472
1714
  }
1473
1715
  return this;
@@ -1488,7 +1730,7 @@
1488
1730
  .hide();
1489
1731
  }
1490
1732
  return this;
1491
- },
1733
+ },
1492
1734
 
1493
1735
  // directional methods
1494
1736
 
@@ -1503,7 +1745,7 @@
1503
1745
 
1504
1746
  if (target.length) {
1505
1747
  this.S('img', target)
1506
- .trigger('click', [current, target]).trigger('click.fndtn.clearing', [current, target])
1748
+ .trigger('click.fndtn.clearing', [current, target])
1507
1749
  .trigger('change.fndtn.clearing');
1508
1750
  }
1509
1751
  },
@@ -1522,7 +1764,7 @@
1522
1764
  // we use jQuery animate instead of CSS transitions because we
1523
1765
  // need a callback to unlock the next animation
1524
1766
  // needs support for RTL **
1525
- if (target.index() !== old_index && !/skip/.test(direction)){
1767
+ if (target.index() !== old_index && !/skip/.test(direction)) {
1526
1768
  if (/left/.test(direction)) {
1527
1769
  this.lock();
1528
1770
  dir_obj[dir] = left + width;
@@ -1578,7 +1820,9 @@
1578
1820
 
1579
1821
  adjacent : function (current_index, target_index) {
1580
1822
  for (var i = target_index + 1; i >= target_index - 1; i--) {
1581
- if (i === current_index) return true;
1823
+ if (i === current_index) {
1824
+ return true;
1825
+ }
1582
1826
  }
1583
1827
  return false;
1584
1828
  },
@@ -1615,21 +1859,23 @@
1615
1859
  Foundation.libs.dropdown = {
1616
1860
  name : 'dropdown',
1617
1861
 
1618
- version : '5.4.7',
1862
+ version : '5.5.2',
1619
1863
 
1620
1864
  settings : {
1621
- active_class: 'open',
1622
- disabled_class: 'disabled',
1623
- mega_class: 'mega',
1624
- align: 'bottom',
1625
- is_hover: false,
1626
- opened: function(){},
1627
- closed: function(){}
1865
+ active_class : 'open',
1866
+ disabled_class : 'disabled',
1867
+ mega_class : 'mega',
1868
+ align : 'bottom',
1869
+ is_hover : false,
1870
+ hover_timeout : 150,
1871
+ opened : function () {},
1872
+ closed : function () {}
1628
1873
  },
1629
1874
 
1630
1875
  init : function (scope, method, options) {
1631
1876
  Foundation.inherit(this, 'throttle');
1632
1877
 
1878
+ $.extend(true, this.settings, method, options);
1633
1879
  this.bindings(method, options);
1634
1880
  },
1635
1881
 
@@ -1643,6 +1889,9 @@
1643
1889
  var settings = S(this).data(self.attr_name(true) + '-init') || self.settings;
1644
1890
  if (!settings.is_hover || Modernizr.touch) {
1645
1891
  e.preventDefault();
1892
+ if (S(this).parent('[data-reveal-id]').length) {
1893
+ e.stopPropagation();
1894
+ }
1646
1895
  self.toggle($(this));
1647
1896
  }
1648
1897
  })
@@ -1658,36 +1907,58 @@
1658
1907
  target = $this;
1659
1908
  } else {
1660
1909
  dropdown = $this;
1661
- target = S("[" + self.attr_name() + "='" + dropdown.attr('id') + "']");
1910
+ target = S('[' + self.attr_name() + '="' + dropdown.attr('id') + '"]');
1662
1911
  }
1663
1912
 
1664
1913
  var settings = target.data(self.attr_name(true) + '-init') || self.settings;
1665
1914
 
1666
- if(S(e.target).data(self.data_attr()) && settings.is_hover) {
1915
+ if (S(e.currentTarget).data(self.data_attr()) && settings.is_hover) {
1667
1916
  self.closeall.call(self);
1668
1917
  }
1669
1918
 
1670
- if (settings.is_hover) self.open.apply(self, [dropdown, target]);
1919
+ if (settings.is_hover) {
1920
+ self.open.apply(self, [dropdown, target]);
1921
+ }
1671
1922
  })
1672
1923
  .on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
1673
1924
  var $this = S(this);
1925
+ var settings;
1926
+
1927
+ if ($this.data(self.data_attr())) {
1928
+ settings = $this.data(self.data_attr(true) + '-init') || self.settings;
1929
+ } else {
1930
+ var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
1931
+ settings = target.data(self.attr_name(true) + '-init') || self.settings;
1932
+ }
1933
+
1674
1934
  self.timeout = setTimeout(function () {
1675
1935
  if ($this.data(self.data_attr())) {
1676
- var settings = $this.data(self.data_attr(true) + '-init') || self.settings;
1677
- if (settings.is_hover) self.close.call(self, S('#' + $this.data(self.data_attr())));
1936
+ if (settings.is_hover) {
1937
+ self.close.call(self, S('#' + $this.data(self.data_attr())));
1938
+ }
1678
1939
  } else {
1679
- var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
1680
- settings = target.data(self.attr_name(true) + '-init') || self.settings;
1681
- if (settings.is_hover) self.close.call(self, $this);
1940
+ if (settings.is_hover) {
1941
+ self.close.call(self, $this);
1942
+ }
1682
1943
  }
1683
- }.bind(this), 150);
1944
+ }.bind(this), settings.hover_timeout);
1684
1945
  })
1685
1946
  .on('click.fndtn.dropdown', function (e) {
1686
1947
  var parent = S(e.target).closest('[' + self.attr_name() + '-content]');
1948
+ var links = parent.find('a');
1949
+
1950
+ if (links.length > 0 && parent.attr('aria-autoclose') !== 'false') {
1951
+ self.close.call(self, S('[' + self.attr_name() + '-content]'));
1952
+ }
1953
+
1954
+ if (e.target !== document && !$.contains(document.documentElement, e.target)) {
1955
+ return;
1956
+ }
1687
1957
 
1688
1958
  if (S(e.target).closest('[' + self.attr_name() + ']').length > 0) {
1689
1959
  return;
1690
1960
  }
1961
+
1691
1962
  if (!(S(e.target).data('revealId')) &&
1692
1963
  (parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') ||
1693
1964
  $.contains(parent.first()[0], e.target)))) {
@@ -1698,10 +1969,10 @@
1698
1969
  self.close.call(self, S('[' + self.attr_name() + '-content]'));
1699
1970
  })
1700
1971
  .on('opened.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
1701
- self.settings.opened.call(this);
1972
+ self.settings.opened.call(this);
1702
1973
  })
1703
1974
  .on('closed.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
1704
- self.settings.closed.call(this);
1975
+ self.settings.closed.call(this);
1705
1976
  });
1706
1977
 
1707
1978
  S(window)
@@ -1713,44 +1984,46 @@
1713
1984
  this.resize();
1714
1985
  },
1715
1986
 
1716
- close: function (dropdown) {
1987
+ close : function (dropdown) {
1717
1988
  var self = this;
1718
- dropdown.each(function () {
1719
- var original_target = $('[' + self.attr_name() + '=' + dropdown[0].id + ']') || $('aria-controls=' + dropdown[0].id+ ']');
1720
- original_target.attr('aria-expanded', "false");
1989
+ dropdown.each(function (idx) {
1990
+ var original_target = $('[' + self.attr_name() + '=' + dropdown[idx].id + ']') || $('aria-controls=' + dropdown[idx].id + ']');
1991
+ original_target.attr('aria-expanded', 'false');
1721
1992
  if (self.S(this).hasClass(self.settings.active_class)) {
1722
1993
  self.S(this)
1723
- .css(Foundation.rtl ? 'right':'left', '-99999px')
1724
- .attr('aria-hidden', "true")
1994
+ .css(Foundation.rtl ? 'right' : 'left', '-99999px')
1995
+ .attr('aria-hidden', 'true')
1725
1996
  .removeClass(self.settings.active_class)
1726
1997
  .prev('[' + self.attr_name() + ']')
1727
1998
  .removeClass(self.settings.active_class)
1728
1999
  .removeData('target');
1729
2000
 
1730
- self.S(this).trigger('closed').trigger('closed.fndtn.dropdown', [dropdown]);
2001
+ self.S(this).trigger('closed.fndtn.dropdown', [dropdown]);
1731
2002
  }
1732
2003
  });
2004
+ dropdown.removeClass('f-open-' + this.attr_name(true));
1733
2005
  },
1734
2006
 
1735
- closeall: function() {
2007
+ closeall : function () {
1736
2008
  var self = this;
1737
- $.each(self.S('[' + this.attr_name() + '-content]'), function() {
2009
+ $.each(self.S('.f-open-' + this.attr_name(true)), function () {
1738
2010
  self.close.call(self, self.S(this));
1739
2011
  });
1740
2012
  },
1741
2013
 
1742
- open: function (dropdown, target) {
1743
- this
1744
- .css(dropdown
1745
- .addClass(this.settings.active_class), target);
1746
- dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
1747
- dropdown.data('target', target.get(0)).trigger('opened').trigger('opened.fndtn.dropdown', [dropdown, target]);
1748
- dropdown.attr('aria-hidden', 'false');
1749
- target.attr('aria-expanded', 'true');
1750
- dropdown.focus();
2014
+ open : function (dropdown, target) {
2015
+ this
2016
+ .css(dropdown
2017
+ .addClass(this.settings.active_class), target);
2018
+ dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
2019
+ dropdown.data('target', target.get(0)).trigger('opened.fndtn.dropdown', [dropdown, target]);
2020
+ dropdown.attr('aria-hidden', 'false');
2021
+ target.attr('aria-expanded', 'true');
2022
+ dropdown.focus();
2023
+ dropdown.addClass('f-open-' + this.attr_name(true));
1751
2024
  },
1752
2025
 
1753
- data_attr: function () {
2026
+ data_attr : function () {
1754
2027
  if (this.namespace.length > 0) {
1755
2028
  return this.namespace + '-' + this.name;
1756
2029
  }
@@ -1772,16 +2045,17 @@
1772
2045
 
1773
2046
  if (dropdown.hasClass(this.settings.active_class)) {
1774
2047
  this.close.call(this, dropdown);
1775
- if (dropdown.data('target') !== target.get(0))
2048
+ if (dropdown.data('target') !== target.get(0)) {
1776
2049
  this.open.call(this, dropdown, target);
2050
+ }
1777
2051
  } else {
1778
2052
  this.open.call(this, dropdown, target);
1779
2053
  }
1780
2054
  },
1781
2055
 
1782
2056
  resize : function () {
1783
- var dropdown = this.S('[' + this.attr_name() + '-content].open'),
1784
- target = this.S("[" + this.attr_name() + "='" + dropdown.attr('id') + "']");
2057
+ var dropdown = this.S('[' + this.attr_name() + '-content].open');
2058
+ var target = $(dropdown.data("target"));
1785
2059
 
1786
2060
  if (dropdown.length && target.length) {
1787
2061
  this.css(dropdown, target);
@@ -1790,22 +2064,37 @@
1790
2064
 
1791
2065
  css : function (dropdown, target) {
1792
2066
  var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8),
1793
- settings = target.data(this.attr_name(true) + '-init') || this.settings;
2067
+ settings = target.data(this.attr_name(true) + '-init') || this.settings,
2068
+ parentOverflow = dropdown.parent().css('overflow-y') || dropdown.parent().css('overflow');
1794
2069
 
1795
2070
  this.clear_idx();
1796
2071
 
2072
+
2073
+
1797
2074
  if (this.small()) {
1798
2075
  var p = this.dirs.bottom.call(dropdown, target, settings);
1799
2076
 
1800
2077
  dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({
1801
2078
  position : 'absolute',
1802
- width: '95%',
1803
- 'max-width': 'none',
1804
- top: p.top
2079
+ width : '95%',
2080
+ 'max-width' : 'none',
2081
+ top : p.top
1805
2082
  });
1806
2083
 
1807
- dropdown.css(Foundation.rtl ? 'right':'left', left_offset);
1808
- } else {
2084
+ dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
2085
+ }
2086
+ // detect if dropdown is in an overflow container
2087
+ else if (parentOverflow !== 'visible') {
2088
+ var offset = target[0].offsetTop + target[0].offsetHeight;
2089
+
2090
+ dropdown.attr('style', '').css({
2091
+ position : 'absolute',
2092
+ top : offset
2093
+ });
2094
+
2095
+ dropdown.css(Foundation.rtl ? 'right' : 'left', left_offset);
2096
+ }
2097
+ else {
1809
2098
 
1810
2099
  this.style(dropdown, target, settings);
1811
2100
  }
@@ -1814,7 +2103,7 @@
1814
2103
  },
1815
2104
 
1816
2105
  style : function (dropdown, target, settings) {
1817
- var css = $.extend({position: 'absolute'},
2106
+ var css = $.extend({position : 'absolute'},
1818
2107
  this.dirs[settings.align].call(dropdown, target, settings));
1819
2108
 
1820
2109
  dropdown.attr('style', '').css(css);
@@ -1832,74 +2121,166 @@
1832
2121
  p.top -= o.top;
1833
2122
  p.left -= o.left;
1834
2123
 
2124
+ //set some flags on the p object to pass along
2125
+ p.missRight = false;
2126
+ p.missTop = false;
2127
+ p.missLeft = false;
2128
+ p.leftRightFlag = false;
2129
+
2130
+ //lets see if the panel will be off the screen
2131
+ //get the actual width of the page and store it
2132
+ var actualBodyWidth;
2133
+ if (document.getElementsByClassName('row')[0]) {
2134
+ actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth;
2135
+ } else {
2136
+ actualBodyWidth = window.innerWidth;
2137
+ }
2138
+
2139
+ var actualMarginWidth = (window.innerWidth - actualBodyWidth) / 2;
2140
+ var actualBoundary = actualBodyWidth;
2141
+
2142
+ if (!this.hasClass('mega')) {
2143
+ //miss top
2144
+ if (t.offset().top <= this.outerHeight()) {
2145
+ p.missTop = true;
2146
+ actualBoundary = window.innerWidth - actualMarginWidth;
2147
+ p.leftRightFlag = true;
2148
+ }
2149
+
2150
+ //miss right
2151
+ if (t.offset().left + this.outerWidth() > t.offset().left + actualMarginWidth && t.offset().left - actualMarginWidth > this.outerWidth()) {
2152
+ p.missRight = true;
2153
+ p.missLeft = false;
2154
+ }
2155
+
2156
+ //miss left
2157
+ if (t.offset().left - this.outerWidth() <= 0) {
2158
+ p.missLeft = true;
2159
+ p.missRight = false;
2160
+ }
2161
+ }
2162
+
1835
2163
  return p;
1836
2164
  },
1837
- top: function (t, s) {
2165
+
2166
+ top : function (t, s) {
1838
2167
  var self = Foundation.libs.dropdown,
1839
2168
  p = self.dirs._base.call(this, t);
1840
2169
 
1841
2170
  this.addClass('drop-top');
1842
2171
 
2172
+ if (p.missTop == true) {
2173
+ p.top = p.top + t.outerHeight() + this.outerHeight();
2174
+ this.removeClass('drop-top');
2175
+ }
2176
+
2177
+ if (p.missRight == true) {
2178
+ p.left = p.left - this.outerWidth() + t.outerWidth();
2179
+ }
2180
+
1843
2181
  if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
1844
- self.adjust_pip(this,t,s,p);
2182
+ self.adjust_pip(this, t, s, p);
1845
2183
  }
1846
2184
 
1847
2185
  if (Foundation.rtl) {
1848
- return {left: p.left - this.outerWidth() + t.outerWidth(),
1849
- top: p.top - this.outerHeight()};
2186
+ return {left : p.left - this.outerWidth() + t.outerWidth(),
2187
+ top : p.top - this.outerHeight()};
1850
2188
  }
1851
2189
 
1852
- return {left: p.left, top: p.top - this.outerHeight()};
2190
+ return {left : p.left, top : p.top - this.outerHeight()};
1853
2191
  },
1854
- bottom: function (t,s) {
2192
+
2193
+ bottom : function (t, s) {
1855
2194
  var self = Foundation.libs.dropdown,
1856
2195
  p = self.dirs._base.call(this, t);
1857
2196
 
2197
+ if (p.missRight == true) {
2198
+ p.left = p.left - this.outerWidth() + t.outerWidth();
2199
+ }
2200
+
1858
2201
  if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
1859
- self.adjust_pip(this,t,s,p);
2202
+ self.adjust_pip(this, t, s, p);
1860
2203
  }
1861
2204
 
1862
2205
  if (self.rtl) {
1863
- return {left: p.left - this.outerWidth() + t.outerWidth(), top: p.top + t.outerHeight()};
2206
+ return {left : p.left - this.outerWidth() + t.outerWidth(), top : p.top + t.outerHeight()};
1864
2207
  }
1865
2208
 
1866
- return {left: p.left, top: p.top + t.outerHeight()};
2209
+ return {left : p.left, top : p.top + t.outerHeight()};
1867
2210
  },
1868
- left: function (t, s) {
2211
+
2212
+ left : function (t, s) {
1869
2213
  var p = Foundation.libs.dropdown.dirs._base.call(this, t);
1870
2214
 
1871
2215
  this.addClass('drop-left');
1872
2216
 
1873
- return {left: p.left - this.outerWidth(), top: p.top};
2217
+ if (p.missLeft == true) {
2218
+ p.left = p.left + this.outerWidth();
2219
+ p.top = p.top + t.outerHeight();
2220
+ this.removeClass('drop-left');
2221
+ }
2222
+
2223
+ return {left : p.left - this.outerWidth(), top : p.top};
1874
2224
  },
1875
- right: function (t, s) {
2225
+
2226
+ right : function (t, s) {
1876
2227
  var p = Foundation.libs.dropdown.dirs._base.call(this, t);
1877
2228
 
1878
2229
  this.addClass('drop-right');
1879
2230
 
1880
- return {left: p.left + t.outerWidth(), top: p.top};
2231
+ if (p.missRight == true) {
2232
+ p.left = p.left - this.outerWidth();
2233
+ p.top = p.top + t.outerHeight();
2234
+ this.removeClass('drop-right');
2235
+ } else {
2236
+ p.triggeredRight = true;
2237
+ }
2238
+
2239
+ var self = Foundation.libs.dropdown;
2240
+
2241
+ if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
2242
+ self.adjust_pip(this, t, s, p);
2243
+ }
2244
+
2245
+ return {left : p.left + t.outerWidth(), top : p.top};
1881
2246
  }
1882
2247
  },
1883
2248
 
1884
2249
  // Insert rule to style psuedo elements
1885
- adjust_pip : function (dropdown,target,settings,position) {
2250
+ adjust_pip : function (dropdown, target, settings, position) {
1886
2251
  var sheet = Foundation.stylesheet,
1887
2252
  pip_offset_base = 8;
1888
2253
 
1889
2254
  if (dropdown.hasClass(settings.mega_class)) {
1890
- pip_offset_base = position.left + (target.outerWidth()/2) - 8;
1891
- }
1892
- else if (this.small()) {
2255
+ pip_offset_base = position.left + (target.outerWidth() / 2) - 8;
2256
+ } else if (this.small()) {
1893
2257
  pip_offset_base += position.left - 8;
1894
2258
  }
1895
2259
 
1896
2260
  this.rule_idx = sheet.cssRules.length;
1897
2261
 
2262
+ //default
1898
2263
  var sel_before = '.f-dropdown.open:before',
1899
2264
  sel_after = '.f-dropdown.open:after',
1900
2265
  css_before = 'left: ' + pip_offset_base + 'px;',
1901
2266
  css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
1902
2267
 
2268
+ if (position.missRight == true) {
2269
+ pip_offset_base = dropdown.outerWidth() - 23;
2270
+ sel_before = '.f-dropdown.open:before',
2271
+ sel_after = '.f-dropdown.open:after',
2272
+ css_before = 'left: ' + pip_offset_base + 'px;',
2273
+ css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
2274
+ }
2275
+
2276
+ //just a case where right is fired, but its not missing right
2277
+ if (position.triggeredRight == true) {
2278
+ sel_before = '.f-dropdown.open:before',
2279
+ sel_after = '.f-dropdown.open:after',
2280
+ css_before = 'left:-12px;',
2281
+ css_after = 'left:-14px;';
2282
+ }
2283
+
1903
2284
  if (sheet.insertRule) {
1904
2285
  sheet.insertRule([sel_before, '{', css_before, '}'].join(' '), this.rule_idx);
1905
2286
  sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx + 1);
@@ -1925,7 +2306,7 @@
1925
2306
  !matchMedia(Foundation.media_queries.medium).matches;
1926
2307
  },
1927
2308
 
1928
- off: function () {
2309
+ off : function () {
1929
2310
  this.S(this.scope).off('.fndtn.dropdown');
1930
2311
  this.S('html, body').off('.fndtn.dropdown');
1931
2312
  this.S(window).off('.fndtn.dropdown');
@@ -1942,13 +2323,14 @@
1942
2323
  Foundation.libs.equalizer = {
1943
2324
  name : 'equalizer',
1944
2325
 
1945
- version : '5.4.7',
2326
+ version : '5.5.2',
1946
2327
 
1947
2328
  settings : {
1948
- use_tallest: true,
1949
- before_height_change: $.noop,
1950
- after_height_change: $.noop,
1951
- equalize_on_stack: false
2329
+ use_tallest : true,
2330
+ before_height_change : $.noop,
2331
+ after_height_change : $.noop,
2332
+ equalize_on_stack : false,
2333
+ act_on_hidden_el: false
1952
2334
  },
1953
2335
 
1954
2336
  init : function (scope, method, options) {
@@ -1958,33 +2340,47 @@
1958
2340
  },
1959
2341
 
1960
2342
  events : function () {
1961
- this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function(e){
2343
+ this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function (e) {
1962
2344
  this.reflow();
1963
2345
  }.bind(this));
1964
2346
  },
1965
2347
 
1966
- equalize: function(equalizer) {
2348
+ equalize : function (equalizer) {
1967
2349
  var isStacked = false,
1968
- vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'),
1969
- settings = equalizer.data(this.attr_name(true)+'-init');
2350
+ group = equalizer.data('equalizer'),
2351
+ settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
2352
+ vals,
2353
+ firstTopOffset;
2354
+
2355
+ if (settings.act_on_hidden_el) {
2356
+ vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]') : equalizer.find('['+this.attr_name()+'-watch]');
2357
+ }
2358
+ else {
2359
+ vals = group ? equalizer.find('['+this.attr_name()+'-watch="'+group+'"]:visible') : equalizer.find('['+this.attr_name()+'-watch]:visible');
2360
+ }
2361
+
2362
+ if (vals.length === 0) {
2363
+ return;
2364
+ }
1970
2365
 
1971
- if (vals.length === 0) return;
1972
- var firstTopOffset = vals.first().offset().top;
1973
2366
  settings.before_height_change();
1974
- equalizer.trigger('before-height-change').trigger('before-height-change.fndth.equalizer');
2367
+ equalizer.trigger('before-height-change.fndth.equalizer');
1975
2368
  vals.height('inherit');
1976
- vals.each(function(){
1977
- var el = $(this);
1978
- if (el.offset().top !== firstTopOffset) {
1979
- isStacked = true;
1980
- }
1981
- });
1982
2369
 
1983
2370
  if (settings.equalize_on_stack === false) {
1984
- if (isStacked) return;
1985
- };
2371
+ firstTopOffset = vals.first().offset().top;
2372
+ vals.each(function () {
2373
+ if ($(this).offset().top !== firstTopOffset) {
2374
+ isStacked = true;
2375
+ return false;
2376
+ }
2377
+ });
2378
+ if (isStacked) {
2379
+ return;
2380
+ }
2381
+ }
1986
2382
 
1987
- var heights = vals.map(function(){ return $(this).outerHeight(false) }).get();
2383
+ var heights = vals.map(function () { return $(this).outerHeight(false) }).get();
1988
2384
 
1989
2385
  if (settings.use_tallest) {
1990
2386
  var max = Math.max.apply(null, heights);
@@ -1993,31 +2389,46 @@
1993
2389
  var min = Math.min.apply(null, heights);
1994
2390
  vals.css('height', min);
1995
2391
  }
2392
+
1996
2393
  settings.after_height_change();
1997
- equalizer.trigger('after-height-change').trigger('after-height-change.fndtn.equalizer');
2394
+ equalizer.trigger('after-height-change.fndtn.equalizer');
1998
2395
  },
1999
2396
 
2000
2397
  reflow : function () {
2001
2398
  var self = this;
2002
2399
 
2003
- this.S('[' + this.attr_name() + ']', this.scope).each(function(){
2004
- var $eq_target = $(this);
2005
- self.image_loaded(self.S('img', this), function(){
2006
- self.equalize($eq_target)
2400
+ this.S('[' + this.attr_name() + ']', this.scope).each(function () {
2401
+ var $eq_target = $(this),
2402
+ media_query = $eq_target.data('equalizer-mq'),
2403
+ ignore_media_query = true;
2404
+
2405
+ if (media_query) {
2406
+ media_query = 'is_' + media_query.replace(/-/g, '_');
2407
+ if (Foundation.utils.hasOwnProperty(media_query)) {
2408
+ ignore_media_query = false;
2409
+ }
2410
+ }
2411
+
2412
+ self.image_loaded(self.S('img', this), function () {
2413
+ if (ignore_media_query || Foundation.utils[media_query]()) {
2414
+ self.equalize($eq_target)
2415
+ } else {
2416
+ var vals = $eq_target.find('[' + self.attr_name() + '-watch]:visible');
2417
+ vals.css('height', 'auto');
2418
+ }
2007
2419
  });
2008
2420
  });
2009
2421
  }
2010
2422
  };
2011
2423
  })(jQuery, window, window.document);
2012
2424
 
2013
-
2014
2425
  ;(function ($, window, document, undefined) {
2015
2426
  'use strict';
2016
2427
 
2017
2428
  Foundation.libs.interchange = {
2018
2429
  name : 'interchange',
2019
2430
 
2020
- version : '5.4.7',
2431
+ version : '5.5.2',
2021
2432
 
2022
2433
  cache : {},
2023
2434
 
@@ -2028,15 +2439,19 @@
2028
2439
  load_attr : 'interchange',
2029
2440
 
2030
2441
  named_queries : {
2031
- 'default' : 'only screen',
2032
- small : Foundation.media_queries.small,
2033
- medium : Foundation.media_queries.medium,
2034
- large : Foundation.media_queries.large,
2035
- xlarge : Foundation.media_queries.xlarge,
2036
- xxlarge: Foundation.media_queries.xxlarge,
2037
- landscape : 'only screen and (orientation: landscape)',
2038
- portrait : 'only screen and (orientation: portrait)',
2039
- retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
2442
+ 'default' : 'only screen',
2443
+ 'small' : Foundation.media_queries['small'],
2444
+ 'small-only' : Foundation.media_queries['small-only'],
2445
+ 'medium' : Foundation.media_queries['medium'],
2446
+ 'medium-only' : Foundation.media_queries['medium-only'],
2447
+ 'large' : Foundation.media_queries['large'],
2448
+ 'large-only' : Foundation.media_queries['large-only'],
2449
+ 'xlarge' : Foundation.media_queries['xlarge'],
2450
+ 'xlarge-only' : Foundation.media_queries['xlarge-only'],
2451
+ 'xxlarge' : Foundation.media_queries['xxlarge'],
2452
+ 'landscape' : 'only screen and (orientation: landscape)',
2453
+ 'portrait' : 'only screen and (orientation: portrait)',
2454
+ 'retina' : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
2040
2455
  'only screen and (min--moz-device-pixel-ratio: 2),' +
2041
2456
  'only screen and (-o-min-device-pixel-ratio: 2/1),' +
2042
2457
  'only screen and (min-device-pixel-ratio: 2),' +
@@ -2045,7 +2460,7 @@
2045
2460
  },
2046
2461
 
2047
2462
  directives : {
2048
- replace: function (el, path, trigger) {
2463
+ replace : function (el, path, trigger) {
2049
2464
  // The trigger argument, if called within the directive, fires
2050
2465
  // an event named after the directive on the element, passing
2051
2466
  // any parameters along to the event that you pass to trigger.
@@ -2057,22 +2472,26 @@
2057
2472
  // console.log($(this).html(), a, b, c);
2058
2473
  // });
2059
2474
 
2060
- if (/IMG/.test(el[0].nodeName)) {
2475
+ if (el !== null && /IMG/.test(el[0].nodeName)) {
2061
2476
  var orig_path = el[0].src;
2062
2477
 
2063
- if (new RegExp(path, 'i').test(orig_path)) return;
2478
+ if (new RegExp(path, 'i').test(orig_path)) {
2479
+ return;
2480
+ }
2064
2481
 
2065
- el[0].src = path;
2482
+ el.attr("src", path);
2066
2483
 
2067
2484
  return trigger(el[0].src);
2068
2485
  }
2069
2486
  var last_path = el.data(this.data_attr + '-last-path'),
2070
2487
  self = this;
2071
2488
 
2072
- if (last_path == path) return;
2489
+ if (last_path == path) {
2490
+ return;
2491
+ }
2073
2492
 
2074
2493
  if (/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(path)) {
2075
- $(el).css('background-image', 'url('+path+')');
2494
+ $(el).css('background-image', 'url(' + path + ')');
2076
2495
  el.data('interchange-last-path', path);
2077
2496
  return trigger(path);
2078
2497
  }
@@ -2093,12 +2512,11 @@
2093
2512
  this.data_attr = this.set_data_attr();
2094
2513
  $.extend(true, this.settings, method, options);
2095
2514
  this.bindings(method, options);
2096
- this.load('images');
2097
- this.load('nodes');
2515
+ this.reflow();
2098
2516
  },
2099
2517
 
2100
- get_media_hash : function() {
2101
- var mediaHash='';
2518
+ get_media_hash : function () {
2519
+ var mediaHash = '';
2102
2520
  for (var queryName in this.settings.named_queries ) {
2103
2521
  mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString();
2104
2522
  }
@@ -2124,7 +2542,7 @@
2124
2542
  resize : function () {
2125
2543
  var cache = this.cache;
2126
2544
 
2127
- if(!this.images_loaded || !this.nodes_loaded) {
2545
+ if (!this.images_loaded || !this.nodes_loaded) {
2128
2546
  setTimeout($.proxy(this.resize, this), 50);
2129
2547
  return;
2130
2548
  }
@@ -2132,18 +2550,19 @@
2132
2550
  for (var uuid in cache) {
2133
2551
  if (cache.hasOwnProperty(uuid)) {
2134
2552
  var passed = this.results(uuid, cache[uuid]);
2135
-
2136
2553
  if (passed) {
2137
2554
  this.settings.directives[passed
2138
- .scenario[1]].call(this, passed.el, passed.scenario[0], function () {
2139
- if (arguments[0] instanceof Array) {
2555
+ .scenario[1]].call(this, passed.el, passed.scenario[0], (function (passed) {
2556
+ if (arguments[0] instanceof Array) {
2140
2557
  var args = arguments[0];
2141
- } else {
2558
+ } else {
2142
2559
  var args = Array.prototype.slice.call(arguments, 0);
2143
2560
  }
2144
2561
 
2145
- passed.el.trigger(passed.scenario[1], args);
2146
- });
2562
+ return function() {
2563
+ passed.el.trigger(passed.scenario[1], args);
2564
+ }
2565
+ }(passed)));
2147
2566
  }
2148
2567
  }
2149
2568
  }
@@ -2164,7 +2583,7 @@
2164
2583
  mq = matchMedia(rule);
2165
2584
  }
2166
2585
  if (mq.matches) {
2167
- return {el: el, scenario: scenarios[count]};
2586
+ return {el : el, scenario : scenarios[count]};
2168
2587
  }
2169
2588
  }
2170
2589
  }
@@ -2220,7 +2639,6 @@
2220
2639
  this.cached_nodes = [];
2221
2640
  this.nodes_loaded = (count === 0);
2222
2641
 
2223
-
2224
2642
  while (i--) {
2225
2643
  loaded_count++;
2226
2644
  var str = nodes[i].getAttribute(data_attr) || '';
@@ -2229,7 +2647,7 @@
2229
2647
  this.cached_nodes.push(nodes[i]);
2230
2648
  }
2231
2649
 
2232
- if(loaded_count === count) {
2650
+ if (loaded_count === count) {
2233
2651
  this.nodes_loaded = true;
2234
2652
  this.enhance('nodes');
2235
2653
  }
@@ -2245,7 +2663,7 @@
2245
2663
  this.object($(this['cached_' + type][i]));
2246
2664
  }
2247
2665
 
2248
- return $(window).trigger('resize').trigger('resize.fndtn.interchange');
2666
+ return $(window).trigger('resize.fndtn.interchange');
2249
2667
  },
2250
2668
 
2251
2669
  convert_directive : function (directive) {
@@ -2262,33 +2680,40 @@
2262
2680
  parse_scenario : function (scenario) {
2263
2681
  // This logic had to be made more complex since some users were using commas in the url path
2264
2682
  // So we cannot simply just split on a comma
2683
+
2265
2684
  var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
2266
- media_query = scenario[1];
2685
+ // getting the mq has gotten a bit complicated since we started accounting for several use cases
2686
+ // of URLs. For now we'll continue to match these scenarios, but we may consider having these scenarios
2687
+ // as nested objects or arrays in F6.
2688
+ // regex: match everything before close parenthesis for mq
2689
+ media_query = scenario[1].match(/(.*)\)/);
2267
2690
 
2268
2691
  if (directive_match) {
2269
2692
  var path = directive_match[1],
2270
2693
  directive = directive_match[2];
2271
- }
2272
- else {
2694
+
2695
+ } else {
2273
2696
  var cached_split = scenario[0].split(/,\s*$/),
2274
2697
  path = cached_split[0],
2275
- directive = '';
2698
+ directive = '';
2276
2699
  }
2277
2700
 
2278
- return [this.trim(path), this.convert_directive(directive), this.trim(media_query)];
2701
+ return [this.trim(path), this.convert_directive(directive), this.trim(media_query[1])];
2279
2702
  },
2280
2703
 
2281
- object : function(el) {
2704
+ object : function (el) {
2282
2705
  var raw_arr = this.parse_data_attr(el),
2283
- scenarios = [],
2706
+ scenarios = [],
2284
2707
  i = raw_arr.length;
2285
2708
 
2286
2709
  if (i > 0) {
2287
2710
  while (i--) {
2288
- var split = raw_arr[i].split(/\((.*?)(\))$/);
2711
+ // split array between comma delimited content and mq
2712
+ // regex: comma, optional space, open parenthesis
2713
+ var scenario = raw_arr[i].split(/,\s?\(/);
2289
2714
 
2290
- if (split.length > 1) {
2291
- var params = this.parse_scenario(split);
2715
+ if (scenario.length > 1) {
2716
+ var params = this.parse_scenario(scenario);
2292
2717
  scenarios.push(params);
2293
2718
  }
2294
2719
  }
@@ -2301,14 +2726,15 @@
2301
2726
  var uuid = this.random_str(),
2302
2727
  current_uuid = el.data(this.add_namespace('uuid', true));
2303
2728
 
2304
- if (this.cache[current_uuid]) return this.cache[current_uuid];
2729
+ if (this.cache[current_uuid]) {
2730
+ return this.cache[current_uuid];
2731
+ }
2305
2732
 
2306
2733
  el.attr(this.add_namespace('data-uuid'), uuid);
2307
-
2308
2734
  return this.cache[uuid] = scenarios;
2309
2735
  },
2310
2736
 
2311
- trim : function(str) {
2737
+ trim : function (str) {
2312
2738
 
2313
2739
  if (typeof str === 'string') {
2314
2740
  return $.trim(str);
@@ -2317,7 +2743,7 @@
2317
2743
  return str;
2318
2744
  },
2319
2745
 
2320
- set_data_attr: function (init) {
2746
+ set_data_attr : function (init) {
2321
2747
  if (init) {
2322
2748
  if (this.namespace.length > 0) {
2323
2749
  return this.namespace + '-' + this.settings.load_attr;
@@ -2335,7 +2761,7 @@
2335
2761
 
2336
2762
  parse_data_attr : function (el) {
2337
2763
  var raw = el.attr(this.attr_name()).split(/\[(.*?)\]/),
2338
- i = raw.length,
2764
+ i = raw.length,
2339
2765
  output = [];
2340
2766
 
2341
2767
  while (i--) {
@@ -2364,7 +2790,7 @@
2364
2790
  Foundation.libs.joyride = {
2365
2791
  name : 'joyride',
2366
2792
 
2367
- version : '5.4.7',
2793
+ version : '5.5.2',
2368
2794
 
2369
2795
  defaults : {
2370
2796
  expose : false, // turn on or off the expose feature
@@ -2390,16 +2816,16 @@
2390
2816
  tip_container : 'body', // Where will the tip be attached
2391
2817
  abort_on_close : true, // When true, the close event will not fire any callback
2392
2818
  tip_location_patterns : {
2393
- top: ['bottom'],
2394
- bottom: [], // bottom should not need to be repositioned
2395
- left: ['right', 'top', 'bottom'],
2396
- right: ['left', 'top', 'bottom']
2819
+ top : ['bottom'],
2820
+ bottom : [], // bottom should not need to be repositioned
2821
+ left : ['right', 'top', 'bottom'],
2822
+ right : ['left', 'top', 'bottom']
2397
2823
  },
2398
- post_ride_callback : function (){}, // A method to call once the tour closes (canceled or complete)
2399
- post_step_callback : function (){}, // A method to call after each step
2400
- pre_step_callback : function (){}, // A method to call before each step
2401
- pre_ride_callback : function (){}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
2402
- post_expose_callback : function (){}, // A method to call after an element has been exposed
2824
+ post_ride_callback : function () {}, // A method to call once the tour closes (canceled or complete)
2825
+ post_step_callback : function () {}, // A method to call after each step
2826
+ pre_step_callback : function () {}, // A method to call before each step
2827
+ pre_ride_callback : function () {}, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
2828
+ post_expose_callback : function () {}, // A method to call after an element has been exposed
2403
2829
  template : { // HTML segments for tip layout
2404
2830
  link : '<a href="#close" class="joyride-close-tip">&times;</a>',
2405
2831
  timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
@@ -2422,7 +2848,7 @@
2422
2848
  this.bindings(method, options)
2423
2849
  },
2424
2850
 
2425
- go_next : function() {
2851
+ go_next : function () {
2426
2852
  if (this.settings.$li.next().length < 1) {
2427
2853
  this.end();
2428
2854
  } else if (this.settings.timer > 0) {
@@ -2436,7 +2862,7 @@
2436
2862
  }
2437
2863
  },
2438
2864
 
2439
- go_prev : function() {
2865
+ go_prev : function () {
2440
2866
  if (this.settings.$li.prev().length < 1) {
2441
2867
  // Do nothing if there are no prev element
2442
2868
  } else if (this.settings.timer > 0) {
@@ -2469,10 +2895,12 @@
2469
2895
  this.end(this.settings.abort_on_close);
2470
2896
  }.bind(this))
2471
2897
 
2472
- .on("keyup.fndtn.joyride", function(e) {
2898
+ .on('keyup.fndtn.joyride', function (e) {
2473
2899
  // Don't do anything if keystrokes are disabled
2474
2900
  // or if the joyride is not being shown
2475
- if (!this.settings.keyboard || !this.settings.riding) return;
2901
+ if (!this.settings.keyboard || !this.settings.riding) {
2902
+ return;
2903
+ }
2476
2904
 
2477
2905
  switch (e.which) {
2478
2906
  case 39: // right arrow
@@ -2518,9 +2946,13 @@
2518
2946
  integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
2519
2947
  int_settings_count = integer_settings.length;
2520
2948
 
2521
- if (!$this.length > 0) return;
2949
+ if (!$this.length > 0) {
2950
+ return;
2951
+ }
2522
2952
 
2523
- if (!this.settings.init) this.events();
2953
+ if (!this.settings.init) {
2954
+ this.events();
2955
+ }
2524
2956
 
2525
2957
  this.settings = $this.data(this.attr_name(true) + '-init');
2526
2958
 
@@ -2613,10 +3045,11 @@
2613
3045
  txt = $.trim(txt) || 'Previous';
2614
3046
 
2615
3047
  // Add the disabled class to the button if it's the first element
2616
- if (idx == 0)
3048
+ if (idx == 0) {
2617
3049
  txt = $(this.settings.template.prev_button).append(txt).addClass('disabled')[0].outerHTML;
2618
- else
3050
+ } else {
2619
3051
  txt = $(this.settings.template.prev_button).append(txt)[0].outerHTML;
3052
+ }
2620
3053
  } else {
2621
3054
  txt = '';
2622
3055
  }
@@ -2625,10 +3058,8 @@
2625
3058
 
2626
3059
  create : function (opts) {
2627
3060
  this.settings.tip_settings = $.extend({}, this.settings, this.data_options(opts.$li));
2628
- var buttonText = opts.$li.attr(this.add_namespace('data-button'))
2629
- || opts.$li.attr(this.add_namespace('data-text')),
2630
- prevButtonText = opts.$li.attr(this.add_namespace('data-button-prev'))
2631
- || opts.$li.attr(this.add_namespace('data-prev-text')),
3061
+ var buttonText = opts.$li.attr(this.add_namespace('data-button')) || opts.$li.attr(this.add_namespace('data-text')),
3062
+ prevButtonText = opts.$li.attr(this.add_namespace('data-button-prev')) || opts.$li.attr(this.add_namespace('data-prev-text')),
2632
3063
  tipClass = opts.$li.attr('class'),
2633
3064
  $tip_content = $(this.tip_template({
2634
3065
  tip_class : tipClass,
@@ -2645,8 +3076,7 @@
2645
3076
  var $timer = null;
2646
3077
 
2647
3078
  // are we paused?
2648
- if (this.settings.$li === undefined
2649
- || ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
3079
+ if (this.settings.$li === undefined || ($.inArray(this.settings.$li.index(), this.settings.pause_after) === -1)) {
2650
3080
 
2651
3081
  // don't go to the next li if the tour was paused
2652
3082
  if (this.settings.paused) {
@@ -2677,8 +3107,14 @@
2677
3107
 
2678
3108
  this.settings.tip_settings.tip_location_pattern = this.settings.tip_location_patterns[this.settings.tip_settings.tip_location];
2679
3109
 
2680
- // scroll if not modal
3110
+ // scroll and hide bg if not modal
2681
3111
  if (!/body/i.test(this.settings.$target.selector)) {
3112
+ var joyridemodalbg = $('.joyride-modal-bg');
3113
+ if (/pop/i.test(this.settings.tipAnimation)) {
3114
+ joyridemodalbg.hide();
3115
+ } else {
3116
+ joyridemodalbg.fadeOut(this.settings.tipAnimationFadeSpeed);
3117
+ }
2682
3118
  this.scroll_to();
2683
3119
  }
2684
3120
 
@@ -2700,7 +3136,7 @@
2700
3136
 
2701
3137
  setTimeout(function () {
2702
3138
  $timer.animate({
2703
- width: $timer.parent().width()
3139
+ width : $timer.parent().width()
2704
3140
  }, this.settings.timer, 'linear');
2705
3141
  }.bind(this), this.settings.tip_animation_fade_speed);
2706
3142
 
@@ -2709,7 +3145,6 @@
2709
3145
 
2710
3146
  }
2711
3147
 
2712
-
2713
3148
  } else if (/fade/i.test(this.settings.tip_animation)) {
2714
3149
 
2715
3150
  $timer.width(0);
@@ -2722,7 +3157,7 @@
2722
3157
 
2723
3158
  setTimeout(function () {
2724
3159
  $timer.animate({
2725
- width: $timer.parent().width()
3160
+ width : $timer.parent().width()
2726
3161
  }, this.settings.timer, 'linear');
2727
3162
  }.bind(this), this.settings.tip_animation_fade_speed);
2728
3163
 
@@ -2767,7 +3202,7 @@
2767
3202
 
2768
3203
  // Prevent scroll bouncing...wait to remove from layout
2769
3204
  this.settings.$current_tip.css('visibility', 'hidden');
2770
- setTimeout($.proxy(function() {
3205
+ setTimeout($.proxy(function () {
2771
3206
  this.hide();
2772
3207
  this.css('visibility', 'visible');
2773
3208
  }, this.settings.$current_tip), 0);
@@ -2781,10 +3216,11 @@
2781
3216
  this.set_next_tip();
2782
3217
  this.settings.$current_tip = this.settings.$next_tip;
2783
3218
  } else {
2784
- if (is_prev)
3219
+ if (is_prev) {
2785
3220
  this.settings.$li = this.settings.$li.prev();
2786
- else
3221
+ } else {
2787
3222
  this.settings.$li = this.settings.$li.next();
3223
+ }
2788
3224
  this.set_next_tip();
2789
3225
  }
2790
3226
 
@@ -2792,7 +3228,7 @@
2792
3228
  },
2793
3229
 
2794
3230
  set_next_tip : function () {
2795
- this.settings.$next_tip = $(".joyride-tip-guide").eq(this.settings.$li.index());
3231
+ this.settings.$next_tip = $('.joyride-tip-guide').eq(this.settings.$li.index());
2796
3232
  this.settings.$next_tip.data('closed', '');
2797
3233
  },
2798
3234
 
@@ -2820,7 +3256,7 @@
2820
3256
 
2821
3257
  if (tipOffset != 0) {
2822
3258
  $('html, body').stop().animate({
2823
- scrollTop: tipOffset
3259
+ scrollTop : tipOffset
2824
3260
  }, this.settings.scroll_speed, 'swing');
2825
3261
  }
2826
3262
  },
@@ -2848,18 +3284,18 @@
2848
3284
  }
2849
3285
 
2850
3286
  if (!/body/i.test(this.settings.$target.selector)) {
2851
- var topAdjustment = this.settings.tip_settings.tipAdjustmentY ? parseInt(this.settings.tip_settings.tipAdjustmentY) : 0,
2852
- leftAdjustment = this.settings.tip_settings.tipAdjustmentX ? parseInt(this.settings.tip_settings.tipAdjustmentX) : 0;
3287
+ var topAdjustment = this.settings.tip_settings.tipAdjustmentY ? parseInt(this.settings.tip_settings.tipAdjustmentY) : 0,
3288
+ leftAdjustment = this.settings.tip_settings.tipAdjustmentX ? parseInt(this.settings.tip_settings.tipAdjustmentX) : 0;
2853
3289
 
2854
3290
  if (this.bottom()) {
2855
3291
  if (this.rtl) {
2856
3292
  this.settings.$next_tip.css({
2857
- top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
2858
- left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
3293
+ top : (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
3294
+ left : this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth() + leftAdjustment});
2859
3295
  } else {
2860
3296
  this.settings.$next_tip.css({
2861
- top: (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
2862
- left: this.settings.$target.offset().left + leftAdjustment});
3297
+ top : (this.settings.$target.offset().top + nub_height + this.settings.$target.outerHeight() + topAdjustment),
3298
+ left : this.settings.$target.offset().left + leftAdjustment});
2863
3299
  }
2864
3300
 
2865
3301
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'top');
@@ -2867,12 +3303,12 @@
2867
3303
  } else if (this.top()) {
2868
3304
  if (this.rtl) {
2869
3305
  this.settings.$next_tip.css({
2870
- top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
2871
- left: this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
3306
+ top : (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
3307
+ left : this.settings.$target.offset().left + this.settings.$target.outerWidth() - this.settings.$next_tip.outerWidth()});
2872
3308
  } else {
2873
3309
  this.settings.$next_tip.css({
2874
- top: (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
2875
- left: this.settings.$target.offset().left + leftAdjustment});
3310
+ top : (this.settings.$target.offset().top - this.settings.$next_tip.outerHeight() - nub_height + topAdjustment),
3311
+ left : this.settings.$target.offset().left + leftAdjustment});
2876
3312
  }
2877
3313
 
2878
3314
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'bottom');
@@ -2880,16 +3316,16 @@
2880
3316
  } else if (this.right()) {
2881
3317
 
2882
3318
  this.settings.$next_tip.css({
2883
- top: this.settings.$target.offset().top + topAdjustment,
2884
- left: (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width + leftAdjustment)});
3319
+ top : this.settings.$target.offset().top + topAdjustment,
3320
+ left : (this.settings.$target.outerWidth() + this.settings.$target.offset().left + nub_width + leftAdjustment)});
2885
3321
 
2886
3322
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'left');
2887
3323
 
2888
3324
  } else if (this.left()) {
2889
3325
 
2890
3326
  this.settings.$next_tip.css({
2891
- top: this.settings.$target.offset().top + topAdjustment,
2892
- left: (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width + leftAdjustment)});
3327
+ top : this.settings.$target.offset().top + topAdjustment,
3328
+ left : (this.settings.$target.offset().left - this.settings.$next_tip.outerWidth() - nub_width + leftAdjustment)});
2893
3329
 
2894
3330
  this.nub_position($nub, this.settings.tip_settings.nub_position, 'right');
2895
3331
 
@@ -2945,12 +3381,12 @@
2945
3381
 
2946
3382
  if (this.top()) {
2947
3383
 
2948
- this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
3384
+ this.settings.$next_tip.offset({top : this.settings.$target.offset().top - tip_height - nub_height});
2949
3385
  $nub.addClass('bottom');
2950
3386
 
2951
3387
  } else {
2952
3388
 
2953
- this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
3389
+ this.settings.$next_tip.offset({top : this.settings.$target.offset().top + target_height + nub_height});
2954
3390
  $nub.addClass('top');
2955
3391
 
2956
3392
  }
@@ -2976,7 +3412,8 @@
2976
3412
  if (!this.settings.$next_tip.data('closed')) {
2977
3413
  var joyridemodalbg = $('.joyride-modal-bg');
2978
3414
  if (joyridemodalbg.length < 1) {
2979
- $('body').append(this.settings.template.modal).show();
3415
+ var joyridemodalbg = $(this.settings.template.modal);
3416
+ joyridemodalbg.appendTo('body');
2980
3417
  }
2981
3418
 
2982
3419
  if (/pop/i.test(this.settings.tip_animation)) {
@@ -2997,14 +3434,14 @@
2997
3434
 
2998
3435
  if (arguments.length > 0 && arguments[0] instanceof $) {
2999
3436
  el = arguments[0];
3000
- } else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
3437
+ } else if (this.settings.$target && !/body/i.test(this.settings.$target.selector)) {
3001
3438
  el = this.settings.$target;
3002
- } else {
3439
+ } else {
3003
3440
  return false;
3004
3441
  }
3005
3442
 
3006
- if(el.length < 1){
3007
- if(window.console){
3443
+ if (el.length < 1) {
3444
+ if (window.console) {
3008
3445
  console.error('element not valid', el);
3009
3446
  }
3010
3447
  return false;
@@ -3013,39 +3450,41 @@
3013
3450
  expose = $(this.settings.template.expose);
3014
3451
  this.settings.$body.append(expose);
3015
3452
  expose.css({
3016
- top: el.offset().top,
3017
- left: el.offset().left,
3018
- width: el.outerWidth(true),
3019
- height: el.outerHeight(true)
3453
+ top : el.offset().top,
3454
+ left : el.offset().left,
3455
+ width : el.outerWidth(true),
3456
+ height : el.outerHeight(true)
3020
3457
  });
3021
3458
 
3022
3459
  exposeCover = $(this.settings.template.expose_cover);
3023
3460
 
3024
3461
  origCSS = {
3025
- zIndex: el.css('z-index'),
3026
- position: el.css('position')
3462
+ zIndex : el.css('z-index'),
3463
+ position : el.css('position')
3027
3464
  };
3028
3465
 
3029
3466
  origClasses = el.attr('class') == null ? '' : el.attr('class');
3030
3467
 
3031
- el.css('z-index',parseInt(expose.css('z-index'))+1);
3468
+ el.css('z-index', parseInt(expose.css('z-index')) + 1);
3032
3469
 
3033
3470
  if (origCSS.position == 'static') {
3034
- el.css('position','relative');
3471
+ el.css('position', 'relative');
3035
3472
  }
3036
3473
 
3037
- el.data('expose-css',origCSS);
3474
+ el.data('expose-css', origCSS);
3038
3475
  el.data('orig-class', origClasses);
3039
3476
  el.attr('class', origClasses + ' ' + this.settings.expose_add_class);
3040
3477
 
3041
3478
  exposeCover.css({
3042
- top: el.offset().top,
3043
- left: el.offset().left,
3044
- width: el.outerWidth(true),
3045
- height: el.outerHeight(true)
3479
+ top : el.offset().top,
3480
+ left : el.offset().left,
3481
+ width : el.outerWidth(true),
3482
+ height : el.outerHeight(true)
3046
3483
  });
3047
3484
 
3048
- if (this.settings.modal) this.show_modal();
3485
+ if (this.settings.modal) {
3486
+ this.show_modal();
3487
+ }
3049
3488
 
3050
3489
  this.settings.$body.append(exposeCover);
3051
3490
  expose.addClass(randId);
@@ -3058,20 +3497,20 @@
3058
3497
  un_expose : function () {
3059
3498
  var exposeId,
3060
3499
  el,
3061
- expose ,
3500
+ expose,
3062
3501
  origCSS,
3063
3502
  origClasses,
3064
3503
  clearAll = false;
3065
3504
 
3066
3505
  if (arguments.length > 0 && arguments[0] instanceof $) {
3067
3506
  el = arguments[0];
3068
- } else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){
3507
+ } else if (this.settings.$target && !/body/i.test(this.settings.$target.selector)) {
3069
3508
  el = this.settings.$target;
3070
- } else {
3509
+ } else {
3071
3510
  return false;
3072
3511
  }
3073
3512
 
3074
- if(el.length < 1){
3513
+ if (el.length < 1) {
3075
3514
  if (window.console) {
3076
3515
  console.error('element not valid', el);
3077
3516
  }
@@ -3100,7 +3539,7 @@
3100
3539
  }
3101
3540
 
3102
3541
  if (origCSS.position != el.css('position')) {
3103
- if(origCSS.position == 'static') {// this is default, no need to set it.
3542
+ if (origCSS.position == 'static') {// this is default, no need to set it.
3104
3543
  el.css('position', '');
3105
3544
  } else {
3106
3545
  el.css('position', origCSS.position);
@@ -3116,7 +3555,7 @@
3116
3555
  this.remove_exposed(el);
3117
3556
  },
3118
3557
 
3119
- add_exposed: function(el){
3558
+ add_exposed : function (el) {
3120
3559
  this.settings.exposed = this.settings.exposed || [];
3121
3560
  if (el instanceof $ || typeof el === 'object') {
3122
3561
  this.settings.exposed.push(el[0]);
@@ -3125,11 +3564,11 @@
3125
3564
  }
3126
3565
  },
3127
3566
 
3128
- remove_exposed: function(el){
3567
+ remove_exposed : function (el) {
3129
3568
  var search, i;
3130
3569
  if (el instanceof $) {
3131
3570
  search = el[0]
3132
- } else if (typeof el == 'string'){
3571
+ } else if (typeof el == 'string') {
3133
3572
  search = el;
3134
3573
  }
3135
3574
 
@@ -3205,7 +3644,9 @@
3205
3644
  var i = hidden_corners.length;
3206
3645
 
3207
3646
  while (i--) {
3208
- if (hidden_corners[i]) return false;
3647
+ if (hidden_corners[i]) {
3648
+ return false;
3649
+ }
3209
3650
  }
3210
3651
 
3211
3652
  return true;
@@ -3233,7 +3674,7 @@
3233
3674
 
3234
3675
  end : function (abort) {
3235
3676
  if (this.settings.cookie_monster) {
3236
- $.cookie(this.settings.cookie_name, 'ridden', { expires: this.settings.cookie_expires, domain: this.settings.cookie_domain });
3677
+ $.cookie(this.settings.cookie_name, 'ridden', {expires : this.settings.cookie_expires, domain : this.settings.cookie_domain});
3237
3678
  }
3238
3679
 
3239
3680
  if (this.settings.timer > 0) {
@@ -3280,14 +3721,17 @@
3280
3721
  Foundation.libs['magellan-expedition'] = {
3281
3722
  name : 'magellan-expedition',
3282
3723
 
3283
- version : '5.4.7',
3724
+ version : '5.5.2',
3284
3725
 
3285
3726
  settings : {
3286
- active_class: 'active',
3287
- threshold: 0, // pixels from the top of the expedition for it to become fixes
3288
- destination_threshold: 20, // pixels from the top of destination for it to be considered active
3289
- throttle_delay: 30, // calculation throttling to increase framerate
3290
- fixed_top: 0 // top distance in pixels assigend to the fixed element on scroll
3727
+ active_class : 'active',
3728
+ threshold : 0, // pixels from the top of the expedition for it to become fixes
3729
+ destination_threshold : 20, // pixels from the top of destination for it to be considered active
3730
+ throttle_delay : 30, // calculation throttling to increase framerate
3731
+ fixed_top : 0, // top distance in pixels assigend to the fixed element on scroll
3732
+ offset_by_height : true, // whether to offset the destination by the expedition height. Usually you want this to be true, unless your expedition is on the side.
3733
+ duration : 700, // animation duration time
3734
+ easing : 'swing' // animation easing
3291
3735
  },
3292
3736
 
3293
3737
  init : function (scope, method, options) {
@@ -3305,49 +3749,53 @@
3305
3749
 
3306
3750
  S(self.scope)
3307
3751
  .off('.magellan')
3308
- .on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href^="#"]', function (e) {
3309
- e.preventDefault();
3310
- var expedition = $(this).closest('[' + self.attr_name() + ']'),
3311
- settings = expedition.data('magellan-expedition-init'),
3312
- hash = this.hash.split('#').join(''),
3313
- target = $("a[name='"+hash+"']");
3314
-
3315
- if (target.length === 0) {
3316
- target = $('#'+hash);
3317
-
3318
- }
3752
+ .on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href*=#]', function (e) {
3753
+ var sameHost = ((this.hostname === location.hostname) || !this.hostname),
3754
+ samePath = self.filterPathname(location.pathname) === self.filterPathname(this.pathname),
3755
+ testHash = this.hash.replace(/(:|\.|\/)/g, '\\$1'),
3756
+ anchor = this;
3319
3757
 
3758
+ if (sameHost && samePath && testHash) {
3759
+ e.preventDefault();
3760
+ var expedition = $(this).closest('[' + self.attr_name() + ']'),
3761
+ settings = expedition.data('magellan-expedition-init'),
3762
+ hash = this.hash.split('#').join(''),
3763
+ target = $('a[name="' + hash + '"]');
3320
3764
 
3321
- // Account for expedition height if fixed position
3322
- var scroll_top = target.offset().top - settings.destination_threshold + 1;
3323
- scroll_top = scroll_top - expedition.outerHeight();
3765
+ if (target.length === 0) {
3766
+ target = $('#' + hash);
3324
3767
 
3325
- $('html, body').stop().animate({
3326
- 'scrollTop': scroll_top
3327
- }, 700, 'swing', function () {
3328
- if(history.pushState) {
3329
- history.pushState(null, null, '#'+hash);
3330
3768
  }
3331
- else {
3332
- location.hash = '#'+hash;
3769
+
3770
+ // Account for expedition height if fixed position
3771
+ var scroll_top = target.offset().top - settings.destination_threshold + 1;
3772
+ if (settings.offset_by_height) {
3773
+ scroll_top = scroll_top - expedition.outerHeight();
3333
3774
  }
3334
- });
3775
+ $('html, body').stop().animate({
3776
+ 'scrollTop' : scroll_top
3777
+ }, settings.duration, settings.easing, function () {
3778
+ if (history.pushState) {
3779
+ history.pushState(null, null, anchor.pathname + '#' + hash);
3780
+ }
3781
+ else {
3782
+ location.hash = anchor.pathname + '#' + hash;
3783
+ }
3784
+ });
3785
+ }
3335
3786
  })
3336
3787
  .on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay));
3337
-
3338
- $(window)
3339
- .on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay));
3340
3788
  },
3341
3789
 
3342
- check_for_arrivals : function() {
3790
+ check_for_arrivals : function () {
3343
3791
  var self = this;
3344
3792
  self.update_arrivals();
3345
3793
  self.update_expedition_positions();
3346
3794
  },
3347
3795
 
3348
- set_expedition_position : function() {
3796
+ set_expedition_position : function () {
3349
3797
  var self = this;
3350
- $('[' + this.attr_name() + '=fixed]', self.scope).each(function(idx, el) {
3798
+ $('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
3351
3799
  var expedition = $(this),
3352
3800
  settings = expedition.data('magellan-expedition-init'),
3353
3801
  styles = expedition.attr('styles'), // save styles
@@ -3358,54 +3806,55 @@
3358
3806
 
3359
3807
  //set fixed-top by attribute
3360
3808
  fixed_top = parseInt(expedition.data('magellan-fixed-top'));
3361
- if(!isNaN(fixed_top))
3362
- self.settings.fixed_top = fixed_top;
3809
+ if (!isNaN(fixed_top)) {
3810
+ self.settings.fixed_top = fixed_top;
3811
+ }
3363
3812
 
3364
3813
  expedition.data(self.data_attr('magellan-top-offset'), top_offset);
3365
3814
  expedition.attr('style', styles);
3366
3815
  });
3367
3816
  },
3368
3817
 
3369
- update_expedition_positions : function() {
3818
+ update_expedition_positions : function () {
3370
3819
  var self = this,
3371
3820
  window_top_offset = $(window).scrollTop();
3372
3821
 
3373
- $('[' + this.attr_name() + '=fixed]', self.scope).each(function() {
3822
+ $('[' + this.attr_name() + '=fixed]', self.scope).each(function () {
3374
3823
  var expedition = $(this),
3375
3824
  settings = expedition.data('magellan-expedition-init'),
3376
3825
  styles = expedition.attr('style'), // save styles
3377
3826
  top_offset = expedition.data('magellan-top-offset');
3378
3827
 
3379
3828
  //scroll to the top distance
3380
- if (window_top_offset+self.settings.fixed_top >= top_offset) {
3829
+ if (window_top_offset + self.settings.fixed_top >= top_offset) {
3381
3830
  // Placeholder allows height calculations to be consistent even when
3382
3831
  // appearing to switch between fixed/non-fixed placement
3383
3832
  var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']');
3384
3833
  if (placeholder.length === 0) {
3385
3834
  placeholder = expedition.clone();
3386
3835
  placeholder.removeAttr(self.attr_name());
3387
- placeholder.attr(self.add_namespace('data-magellan-expedition-clone'),'');
3836
+ placeholder.attr(self.add_namespace('data-magellan-expedition-clone'), '');
3388
3837
  expedition.before(placeholder);
3389
3838
  }
3390
- expedition.css({position:'fixed', top: settings.fixed_top}).addClass('fixed');
3839
+ expedition.css({position :'fixed', top : settings.fixed_top}).addClass('fixed');
3391
3840
  } else {
3392
3841
  expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove();
3393
- expedition.attr('style',styles).css('position','').css('top','').removeClass('fixed');
3842
+ expedition.attr('style', styles).css('position', '').css('top', '').removeClass('fixed');
3394
3843
  }
3395
3844
  });
3396
3845
  },
3397
3846
 
3398
- update_arrivals : function() {
3847
+ update_arrivals : function () {
3399
3848
  var self = this,
3400
3849
  window_top_offset = $(window).scrollTop();
3401
3850
 
3402
- $('[' + this.attr_name() + ']', self.scope).each(function() {
3851
+ $('[' + this.attr_name() + ']', self.scope).each(function () {
3403
3852
  var expedition = $(this),
3404
3853
  settings = expedition.data(self.attr_name(true) + '-init'),
3405
3854
  offsets = self.offsets(expedition, window_top_offset),
3406
3855
  arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'),
3407
3856
  active_item = false;
3408
- offsets.each(function(idx, item) {
3857
+ offsets.each(function (idx, item) {
3409
3858
  if (item.viewport_offset >= item.top_offset) {
3410
3859
  var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']');
3411
3860
  arrivals.not(item.arrival).removeClass(settings.active_class);
@@ -3415,20 +3864,26 @@
3415
3864
  }
3416
3865
  });
3417
3866
 
3418
- if (!active_item) arrivals.removeClass(settings.active_class);
3867
+ if (!active_item) {
3868
+ arrivals.removeClass(settings.active_class);
3869
+ }
3419
3870
  });
3420
3871
  },
3421
3872
 
3422
- offsets : function(expedition, window_offset) {
3873
+ offsets : function (expedition, window_offset) {
3423
3874
  var self = this,
3424
3875
  settings = expedition.data(self.attr_name(true) + '-init'),
3425
3876
  viewport_offset = window_offset;
3426
3877
 
3427
- return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function(idx, el) {
3878
+ return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function (idx, el) {
3428
3879
  var name = $(this).data(self.data_attr('magellan-arrival')),
3429
3880
  dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']');
3430
3881
  if (dest.length > 0) {
3431
- var top_offset = Math.floor(dest.offset().top - settings.destination_threshold - expedition.outerHeight());
3882
+ var top_offset = dest.offset().top - settings.destination_threshold;
3883
+ if (settings.offset_by_height) {
3884
+ top_offset = top_offset - expedition.outerHeight();
3885
+ }
3886
+ top_offset = Math.floor(top_offset);
3432
3887
  return {
3433
3888
  destination : dest,
3434
3889
  arrival : $(this),
@@ -3436,14 +3891,18 @@
3436
3891
  viewport_offset : viewport_offset
3437
3892
  }
3438
3893
  }
3439
- }).sort(function(a, b) {
3440
- if (a.top_offset < b.top_offset) return -1;
3441
- if (a.top_offset > b.top_offset) return 1;
3894
+ }).sort(function (a, b) {
3895
+ if (a.top_offset < b.top_offset) {
3896
+ return -1;
3897
+ }
3898
+ if (a.top_offset > b.top_offset) {
3899
+ return 1;
3900
+ }
3442
3901
  return 0;
3443
3902
  });
3444
3903
  },
3445
3904
 
3446
- data_attr: function (str) {
3905
+ data_attr : function (str) {
3447
3906
  if (this.namespace.length > 0) {
3448
3907
  return this.namespace + '-' + str;
3449
3908
  }
@@ -3456,6 +3915,14 @@
3456
3915
  this.S(window).off('.magellan');
3457
3916
  },
3458
3917
 
3918
+ filterPathname : function (pathname) {
3919
+ pathname = pathname || '';
3920
+ return pathname
3921
+ .replace(/^\//,'')
3922
+ .replace(/(?:index|default).[a-zA-Z]{3,4}$/,'')
3923
+ .replace(/\/$/,'');
3924
+ },
3925
+
3459
3926
  reflow : function () {
3460
3927
  var self = this;
3461
3928
  // remove placeholder expeditions used for height calculation purposes
@@ -3470,11 +3937,11 @@
3470
3937
  Foundation.libs.offcanvas = {
3471
3938
  name : 'offcanvas',
3472
3939
 
3473
- version : '5.4.7',
3940
+ version : '5.5.2',
3474
3941
 
3475
3942
  settings : {
3476
- open_method: 'move',
3477
- close_on_click: false
3943
+ open_method : 'move',
3944
+ close_on_click : false
3478
3945
  },
3479
3946
 
3480
3947
  init : function (scope, method, options) {
@@ -3503,8 +3970,8 @@
3503
3970
  S(this.scope).off('.offcanvas')
3504
3971
  .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
3505
3972
  self.click_toggle_class(e, move_class + right_postfix);
3506
- if (self.settings.open_method !== 'overlap'){
3507
- S(".left-submenu").removeClass(move_class + right_postfix);
3973
+ if (self.settings.open_method !== 'overlap') {
3974
+ S('.left-submenu').removeClass(move_class + right_postfix);
3508
3975
  }
3509
3976
  $('.left-off-canvas-toggle').attr('aria-expanded', 'true');
3510
3977
  })
@@ -3512,13 +3979,13 @@
3512
3979
  var settings = self.get_settings(e);
3513
3980
  var parent = S(this).parent();
3514
3981
 
3515
- if(settings.close_on_click && !parent.hasClass("has-submenu") && !parent.hasClass("back")){
3982
+ if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
3516
3983
  self.hide.call(self, move_class + right_postfix, self.get_wrapper(e));
3517
3984
  parent.parent().removeClass(move_class + right_postfix);
3518
- }else if(S(this).parent().hasClass("has-submenu")){
3985
+ } else if (S(this).parent().hasClass('has-submenu')) {
3519
3986
  e.preventDefault();
3520
- S(this).siblings(".left-submenu").toggleClass(move_class + right_postfix);
3521
- }else if(parent.hasClass("back")){
3987
+ S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix);
3988
+ } else if (parent.hasClass('back')) {
3522
3989
  e.preventDefault();
3523
3990
  parent.parent().removeClass(move_class + right_postfix);
3524
3991
  }
@@ -3526,8 +3993,8 @@
3526
3993
  })
3527
3994
  .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
3528
3995
  self.click_toggle_class(e, move_class + left_postfix);
3529
- if (self.settings.open_method !== 'overlap'){
3530
- S(".right-submenu").removeClass(move_class + left_postfix);
3996
+ if (self.settings.open_method !== 'overlap') {
3997
+ S('.right-submenu').removeClass(move_class + left_postfix);
3531
3998
  }
3532
3999
  $('.right-off-canvas-toggle').attr('aria-expanded', 'true');
3533
4000
  })
@@ -3535,13 +4002,13 @@
3535
4002
  var settings = self.get_settings(e);
3536
4003
  var parent = S(this).parent();
3537
4004
 
3538
- if(settings.close_on_click && !parent.hasClass("has-submenu") && !parent.hasClass("back")){
4005
+ if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
3539
4006
  self.hide.call(self, move_class + left_postfix, self.get_wrapper(e));
3540
4007
  parent.parent().removeClass(move_class + left_postfix);
3541
- }else if(S(this).parent().hasClass("has-submenu")){
4008
+ } else if (S(this).parent().hasClass('has-submenu')) {
3542
4009
  e.preventDefault();
3543
- S(this).siblings(".right-submenu").toggleClass(move_class + left_postfix);
3544
- }else if(parent.hasClass("back")){
4010
+ S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix);
4011
+ } else if (parent.hasClass('back')) {
3545
4012
  e.preventDefault();
3546
4013
  parent.parent().removeClass(move_class + left_postfix);
3547
4014
  }
@@ -3549,10 +4016,10 @@
3549
4016
  })
3550
4017
  .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
3551
4018
  self.click_remove_class(e, move_class + left_postfix);
3552
- S(".right-submenu").removeClass(move_class + left_postfix);
3553
- if (right_postfix){
4019
+ S('.right-submenu').removeClass(move_class + left_postfix);
4020
+ if (right_postfix) {
3554
4021
  self.click_remove_class(e, move_class + right_postfix);
3555
- S(".left-submenu").removeClass(move_class + left_postfix);
4022
+ S('.left-submenu').removeClass(move_class + left_postfix);
3556
4023
  }
3557
4024
  $('.right-off-canvas-toggle').attr('aria-expanded', 'true');
3558
4025
  })
@@ -3561,12 +4028,12 @@
3561
4028
  $('.left-off-canvas-toggle').attr('aria-expanded', 'false');
3562
4029
  if (right_postfix) {
3563
4030
  self.click_remove_class(e, move_class + right_postfix);
3564
- $('.right-off-canvas-toggle').attr('aria-expanded', "false");
4031
+ $('.right-off-canvas-toggle').attr('aria-expanded', 'false');
3565
4032
  }
3566
4033
  });
3567
4034
  },
3568
4035
 
3569
- toggle: function(class_name, $off_canvas) {
4036
+ toggle : function (class_name, $off_canvas) {
3570
4037
  $off_canvas = $off_canvas || this.get_wrapper();
3571
4038
  if ($off_canvas.is('.' + class_name)) {
3572
4039
  this.hide(class_name, $off_canvas);
@@ -3575,36 +4042,36 @@
3575
4042
  }
3576
4043
  },
3577
4044
 
3578
- show: function(class_name, $off_canvas) {
4045
+ show : function (class_name, $off_canvas) {
3579
4046
  $off_canvas = $off_canvas || this.get_wrapper();
3580
- $off_canvas.trigger('open').trigger('open.fndtn.offcanvas');
4047
+ $off_canvas.trigger('open.fndtn.offcanvas');
3581
4048
  $off_canvas.addClass(class_name);
3582
4049
  },
3583
4050
 
3584
- hide: function(class_name, $off_canvas) {
4051
+ hide : function (class_name, $off_canvas) {
3585
4052
  $off_canvas = $off_canvas || this.get_wrapper();
3586
- $off_canvas.trigger('close').trigger('close.fndtn.offcanvas');
4053
+ $off_canvas.trigger('close.fndtn.offcanvas');
3587
4054
  $off_canvas.removeClass(class_name);
3588
4055
  },
3589
4056
 
3590
- click_toggle_class: function(e, class_name) {
4057
+ click_toggle_class : function (e, class_name) {
3591
4058
  e.preventDefault();
3592
4059
  var $off_canvas = this.get_wrapper(e);
3593
4060
  this.toggle(class_name, $off_canvas);
3594
4061
  },
3595
4062
 
3596
- click_remove_class: function(e, class_name) {
4063
+ click_remove_class : function (e, class_name) {
3597
4064
  e.preventDefault();
3598
4065
  var $off_canvas = this.get_wrapper(e);
3599
4066
  this.hide(class_name, $off_canvas);
3600
4067
  },
3601
4068
 
3602
- get_settings: function(e) {
4069
+ get_settings : function (e) {
3603
4070
  var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']');
3604
4071
  return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
3605
4072
  },
3606
4073
 
3607
- get_wrapper: function(e) {
4074
+ get_wrapper : function (e) {
3608
4075
  var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap');
3609
4076
 
3610
4077
  if ($off_canvas.length === 0) {
@@ -3620,9 +4087,9 @@
3620
4087
  ;(function ($, window, document, undefined) {
3621
4088
  'use strict';
3622
4089
 
3623
- var noop = function() {};
4090
+ var noop = function () {};
3624
4091
 
3625
- var Orbit = function(el, settings) {
4092
+ var Orbit = function (el, settings) {
3626
4093
  // Don't reinitialize plugin
3627
4094
  if (el.hasClass(settings.slides_container_class)) {
3628
4095
  return this;
@@ -3640,16 +4107,15 @@
3640
4107
  locked = false,
3641
4108
  adjust_height_after = false;
3642
4109
 
3643
-
3644
- self.slides = function() {
4110
+ self.slides = function () {
3645
4111
  return slides_container.children(settings.slide_selector);
3646
4112
  };
3647
4113
 
3648
4114
  self.slides().first().addClass(settings.active_slide_class);
3649
4115
 
3650
- self.update_slide_number = function(index) {
4116
+ self.update_slide_number = function (index) {
3651
4117
  if (settings.slide_number) {
3652
- number_container.find('span:first').text(parseInt(index)+1);
4118
+ number_container.find('span:first').text(parseInt(index) + 1);
3653
4119
  number_container.find('span:last').text(self.slides().length);
3654
4120
  }
3655
4121
  if (settings.bullets) {
@@ -3658,14 +4124,14 @@
3658
4124
  }
3659
4125
  };
3660
4126
 
3661
- self.update_active_link = function(index) {
3662
- var link = $('[data-orbit-link="'+self.slides().eq(index).attr('data-orbit-slide')+'"]');
4127
+ self.update_active_link = function (index) {
4128
+ var link = $('[data-orbit-link="' + self.slides().eq(index).attr('data-orbit-slide') + '"]');
3663
4129
  link.siblings().removeClass(settings.bullets_active_class);
3664
4130
  link.addClass(settings.bullets_active_class);
3665
4131
  };
3666
4132
 
3667
- self.build_markup = function() {
3668
- slides_container.wrap('<div class="'+settings.container_class+'"></div>');
4133
+ self.build_markup = function () {
4134
+ slides_container.wrap('<div class="' + settings.container_class + '"></div>');
3669
4135
  container = slides_container.parent();
3670
4136
  slides_container.addClass(settings.slides_container_class);
3671
4137
 
@@ -3696,7 +4162,7 @@
3696
4162
  bullets_container = $('<ol>').addClass(settings.bullets_container_class);
3697
4163
  container.append(bullets_container);
3698
4164
  bullets_container.wrap('<div class="orbit-bullets-container"></div>');
3699
- self.slides().each(function(idx, el) {
4165
+ self.slides().each(function (idx, el) {
3700
4166
  var bullet = $('<li>').attr('data-orbit-slide', idx).on('click', self.link_bullet);;
3701
4167
  bullets_container.append(bullet);
3702
4168
  });
@@ -3704,7 +4170,7 @@
3704
4170
 
3705
4171
  };
3706
4172
 
3707
- self._goto = function(next_idx, start_timer) {
4173
+ self._goto = function (next_idx, start_timer) {
3708
4174
  // if (locked) {return false;}
3709
4175
  if (next_idx === idx) {return false;}
3710
4176
  if (typeof timer === 'object') {timer.restart();}
@@ -3714,10 +4180,14 @@
3714
4180
  locked = true;
3715
4181
  if (next_idx < idx) {dir = 'prev';}
3716
4182
  if (next_idx >= slides.length) {
3717
- if (!settings.circular) return false;
4183
+ if (!settings.circular) {
4184
+ return false;
4185
+ }
3718
4186
  next_idx = 0;
3719
4187
  } else if (next_idx < 0) {
3720
- if (!settings.circular) return false;
4188
+ if (!settings.circular) {
4189
+ return false;
4190
+ }
3721
4191
  next_idx = slides.length - 1;
3722
4192
  }
3723
4193
 
@@ -3732,17 +4202,17 @@
3732
4202
  settings.before_slide_change();
3733
4203
  self.update_active_link(next_idx);
3734
4204
 
3735
- var callback = function() {
3736
- var unlock = function() {
4205
+ var callback = function () {
4206
+ var unlock = function () {
3737
4207
  idx = next_idx;
3738
4208
  locked = false;
3739
4209
  if (start_timer === true) {timer = self.create_timer(); timer.start();}
3740
4210
  self.update_slide_number(idx);
3741
- slides_container.trigger('after-slide-change.fndtn.orbit',[{slide_number: idx, total_slides: slides.length}]);
4211
+ slides_container.trigger('after-slide-change.fndtn.orbit', [{slide_number : idx, total_slides : slides.length}]);
3742
4212
  settings.after_slide_change(idx, slides.length);
3743
4213
  };
3744
- if (slides_container.height() != next.height() && settings.variable_height) {
3745
- slides_container.animate({'height': next.height()}, 250, 'linear', unlock);
4214
+ if (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {
4215
+ slides_container.animate({'height': next.outerHeight()}, 250, 'linear', unlock);
3746
4216
  } else {
3747
4217
  unlock();
3748
4218
  }
@@ -3750,129 +4220,132 @@
3750
4220
 
3751
4221
  if (slides.length === 1) {callback(); return false;}
3752
4222
 
3753
- var start_animation = function() {
4223
+ var start_animation = function () {
3754
4224
  if (dir === 'next') {animate.next(current, next, callback);}
3755
4225
  if (dir === 'prev') {animate.prev(current, next, callback);}
3756
4226
  };
3757
4227
 
3758
- if (next.height() > slides_container.height() && settings.variable_height) {
3759
- slides_container.animate({'height': next.height()}, 250, 'linear', start_animation);
4228
+ if (next.outerHeight() > slides_container.outerHeight() && settings.variable_height) {
4229
+ slides_container.animate({'height': next.outerHeight()}, 250, 'linear', start_animation);
3760
4230
  } else {
3761
4231
  start_animation();
3762
4232
  }
3763
4233
  };
3764
4234
 
3765
- self.next = function(e) {
4235
+ self.next = function (e) {
3766
4236
  e.stopImmediatePropagation();
3767
4237
  e.preventDefault();
3768
4238
  self._goto(idx + 1);
3769
4239
  };
3770
4240
 
3771
- self.prev = function(e) {
4241
+ self.prev = function (e) {
3772
4242
  e.stopImmediatePropagation();
3773
4243
  e.preventDefault();
3774
4244
  self._goto(idx - 1);
3775
4245
  };
3776
4246
 
3777
- self.link_custom = function(e) {
4247
+ self.link_custom = function (e) {
3778
4248
  e.preventDefault();
3779
4249
  var link = $(this).attr('data-orbit-link');
3780
- if ((typeof link === 'string') && (link = $.trim(link)) != "") {
3781
- var slide = container.find('[data-orbit-slide='+link+']');
4250
+ if ((typeof link === 'string') && (link = $.trim(link)) != '') {
4251
+ var slide = container.find('[data-orbit-slide=' + link + ']');
3782
4252
  if (slide.index() != -1) {self._goto(slide.index());}
3783
4253
  }
3784
4254
  };
3785
4255
 
3786
- self.link_bullet = function(e) {
4256
+ self.link_bullet = function (e) {
3787
4257
  var index = $(this).attr('data-orbit-slide');
3788
- if ((typeof index === 'string') && (index = $.trim(index)) != "") {
3789
- if(isNaN(parseInt(index)))
3790
- {
3791
- var slide = container.find('[data-orbit-slide='+index+']');
4258
+ if ((typeof index === 'string') && (index = $.trim(index)) != '') {
4259
+ if (isNaN(parseInt(index))) {
4260
+ var slide = container.find('[data-orbit-slide=' + index + ']');
3792
4261
  if (slide.index() != -1) {self._goto(slide.index() + 1);}
3793
- }
3794
- else
3795
- {
4262
+ } else {
3796
4263
  self._goto(parseInt(index));
3797
4264
  }
3798
4265
  }
3799
4266
 
3800
4267
  }
3801
4268
 
3802
- self.timer_callback = function() {
4269
+ self.timer_callback = function () {
3803
4270
  self._goto(idx + 1, true);
3804
4271
  }
3805
4272
 
3806
- self.compute_dimensions = function() {
4273
+ self.compute_dimensions = function () {
3807
4274
  var current = $(self.slides().get(idx));
3808
- var h = current.height();
4275
+ var h = current.outerHeight();
3809
4276
  if (!settings.variable_height) {
3810
4277
  self.slides().each(function(){
3811
- if ($(this).height() > h) { h = $(this).height(); }
4278
+ if ($(this).outerHeight() > h) { h = $(this).outerHeight(); }
3812
4279
  });
3813
4280
  }
3814
4281
  slides_container.height(h);
3815
4282
  };
3816
4283
 
3817
- self.create_timer = function() {
4284
+ self.create_timer = function () {
3818
4285
  var t = new Timer(
3819
- container.find('.'+settings.timer_container_class),
4286
+ container.find('.' + settings.timer_container_class),
3820
4287
  settings,
3821
4288
  self.timer_callback
3822
4289
  );
3823
4290
  return t;
3824
4291
  };
3825
4292
 
3826
- self.stop_timer = function() {
3827
- if (typeof timer === 'object') timer.stop();
4293
+ self.stop_timer = function () {
4294
+ if (typeof timer === 'object') {
4295
+ timer.stop();
4296
+ }
3828
4297
  };
3829
4298
 
3830
- self.toggle_timer = function() {
3831
- var t = container.find('.'+settings.timer_container_class);
4299
+ self.toggle_timer = function () {
4300
+ var t = container.find('.' + settings.timer_container_class);
3832
4301
  if (t.hasClass(settings.timer_paused_class)) {
3833
4302
  if (typeof timer === 'undefined') {timer = self.create_timer();}
3834
4303
  timer.start();
3835
- }
3836
- else {
4304
+ } else {
3837
4305
  if (typeof timer === 'object') {timer.stop();}
3838
4306
  }
3839
4307
  };
3840
4308
 
3841
- self.init = function() {
4309
+ self.init = function () {
3842
4310
  self.build_markup();
3843
4311
  if (settings.timer) {
3844
4312
  timer = self.create_timer();
3845
4313
  Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
3846
4314
  }
3847
4315
  animate = new FadeAnimation(settings, slides_container);
3848
- if (settings.animation === 'slide')
4316
+ if (settings.animation === 'slide') {
3849
4317
  animate = new SlideAnimation(settings, slides_container);
4318
+ }
3850
4319
 
3851
- container.on('click', '.'+settings.next_class, self.next);
3852
- container.on('click', '.'+settings.prev_class, self.prev);
4320
+ container.on('click', '.' + settings.next_class, self.next);
4321
+ container.on('click', '.' + settings.prev_class, self.prev);
3853
4322
 
3854
4323
  if (settings.next_on_click) {
3855
- container.on('click', '.'+settings.slides_container_class+' [data-orbit-slide]', self.link_bullet);
4324
+ container.on('click', '.' + settings.slides_container_class + ' [data-orbit-slide]', self.link_bullet);
3856
4325
  }
3857
4326
 
3858
4327
  container.on('click', self.toggle_timer);
3859
4328
  if (settings.swipe) {
3860
- container.on('touchstart.fndtn.orbit', function(e) {
4329
+ container.on('touchstart.fndtn.orbit', function (e) {
3861
4330
  if (!e.touches) {e = e.originalEvent;}
3862
4331
  var data = {
3863
- start_page_x: e.touches[0].pageX,
3864
- start_page_y: e.touches[0].pageY,
3865
- start_time: (new Date()).getTime(),
3866
- delta_x: 0,
3867
- is_scrolling: undefined
4332
+ start_page_x : e.touches[0].pageX,
4333
+ start_page_y : e.touches[0].pageY,
4334
+ start_time : (new Date()).getTime(),
4335
+ delta_x : 0,
4336
+ is_scrolling : undefined
3868
4337
  };
3869
4338
  container.data('swipe-transition', data);
3870
4339
  e.stopPropagation();
3871
4340
  })
3872
- .on('touchmove.fndtn.orbit', function(e) {
3873
- if (!e.touches) { e = e.originalEvent; }
4341
+ .on('touchmove.fndtn.orbit', function (e) {
4342
+ if (!e.touches) {
4343
+ e = e.originalEvent;
4344
+ }
3874
4345
  // Ignore pinch/zoom events
3875
- if(e.touches.length > 1 || e.scale && e.scale !== 1) return;
4346
+ if (e.touches.length > 1 || e.scale && e.scale !== 1) {
4347
+ return;
4348
+ }
3876
4349
 
3877
4350
  var data = container.data('swipe-transition');
3878
4351
  if (typeof data === 'undefined') {data = {};}
@@ -3885,22 +4358,22 @@
3885
4358
 
3886
4359
  if (!data.is_scrolling && !data.active) {
3887
4360
  e.preventDefault();
3888
- var direction = (data.delta_x < 0) ? (idx+1) : (idx-1);
4361
+ var direction = (data.delta_x < 0) ? (idx + 1) : (idx - 1);
3889
4362
  data.active = true;
3890
4363
  self._goto(direction);
3891
4364
  }
3892
4365
  })
3893
- .on('touchend.fndtn.orbit', function(e) {
4366
+ .on('touchend.fndtn.orbit', function (e) {
3894
4367
  container.data('swipe-transition', {});
3895
4368
  e.stopPropagation();
3896
4369
  })
3897
4370
  }
3898
- container.on('mouseenter.fndtn.orbit', function(e) {
4371
+ container.on('mouseenter.fndtn.orbit', function (e) {
3899
4372
  if (settings.timer && settings.pause_on_hover) {
3900
4373
  self.stop_timer();
3901
4374
  }
3902
4375
  })
3903
- .on('mouseleave.fndtn.orbit', function(e) {
4376
+ .on('mouseleave.fndtn.orbit', function (e) {
3904
4377
  if (settings.timer && settings.resume_on_mouseout) {
3905
4378
  timer.start();
3906
4379
  }
@@ -3909,8 +4382,8 @@
3909
4382
  $(document).on('click', '[data-orbit-link]', self.link_custom);
3910
4383
  $(window).on('load resize', self.compute_dimensions);
3911
4384
  Foundation.utils.image_loaded(this.slides().children('img'), self.compute_dimensions);
3912
- Foundation.utils.image_loaded(this.slides().children('img'), function() {
3913
- container.prev('.'+settings.preloader_class).css('display', 'none');
4385
+ Foundation.utils.image_loaded(this.slides().children('img'), function () {
4386
+ container.prev('.' + settings.preloader_class).css('display', 'none');
3914
4387
  self.update_slide_number(0);
3915
4388
  self.update_active_link(0);
3916
4389
  slides_container.trigger('ready.fndtn.orbit');
@@ -3920,43 +4393,43 @@
3920
4393
  self.init();
3921
4394
  };
3922
4395
 
3923
- var Timer = function(el, settings, callback) {
4396
+ var Timer = function (el, settings, callback) {
3924
4397
  var self = this,
3925
4398
  duration = settings.timer_speed,
3926
- progress = el.find('.'+settings.timer_progress_class),
4399
+ progress = el.find('.' + settings.timer_progress_class),
3927
4400
  start,
3928
4401
  timeout,
3929
4402
  left = -1;
3930
4403
 
3931
- this.update_progress = function(w) {
4404
+ this.update_progress = function (w) {
3932
4405
  var new_progress = progress.clone();
3933
4406
  new_progress.attr('style', '');
3934
- new_progress.css('width', w+'%');
4407
+ new_progress.css('width', w + '%');
3935
4408
  progress.replaceWith(new_progress);
3936
4409
  progress = new_progress;
3937
4410
  };
3938
4411
 
3939
- this.restart = function() {
4412
+ this.restart = function () {
3940
4413
  clearTimeout(timeout);
3941
4414
  el.addClass(settings.timer_paused_class);
3942
4415
  left = -1;
3943
4416
  self.update_progress(0);
3944
4417
  };
3945
4418
 
3946
- this.start = function() {
4419
+ this.start = function () {
3947
4420
  if (!el.hasClass(settings.timer_paused_class)) {return true;}
3948
4421
  left = (left === -1) ? duration : left;
3949
4422
  el.removeClass(settings.timer_paused_class);
3950
4423
  start = new Date().getTime();
3951
- progress.animate({'width': '100%'}, left, 'linear');
3952
- timeout = setTimeout(function() {
4424
+ progress.animate({'width' : '100%'}, left, 'linear');
4425
+ timeout = setTimeout(function () {
3953
4426
  self.restart();
3954
4427
  callback();
3955
4428
  }, left);
3956
4429
  el.trigger('timer-started.fndtn.orbit')
3957
4430
  };
3958
4431
 
3959
- this.stop = function() {
4432
+ this.stop = function () {
3960
4433
  if (el.hasClass(settings.timer_paused_class)) {return true;}
3961
4434
  clearTimeout(timeout);
3962
4435
  el.addClass(settings.timer_paused_class);
@@ -3968,95 +4441,94 @@
3968
4441
  };
3969
4442
  };
3970
4443
 
3971
- var SlideAnimation = function(settings, container) {
4444
+ var SlideAnimation = function (settings, container) {
3972
4445
  var duration = settings.animation_speed;
3973
4446
  var is_rtl = ($('html[dir=rtl]').length === 1);
3974
4447
  var margin = is_rtl ? 'marginRight' : 'marginLeft';
3975
4448
  var animMargin = {};
3976
4449
  animMargin[margin] = '0%';
3977
4450
 
3978
- this.next = function(current, next, callback) {
3979
- current.animate({marginLeft:'-100%'}, duration);
3980
- next.animate(animMargin, duration, function() {
4451
+ this.next = function (current, next, callback) {
4452
+ current.animate({marginLeft : '-100%'}, duration);
4453
+ next.animate(animMargin, duration, function () {
3981
4454
  current.css(margin, '100%');
3982
4455
  callback();
3983
4456
  });
3984
4457
  };
3985
4458
 
3986
- this.prev = function(current, prev, callback) {
3987
- current.animate({marginLeft:'100%'}, duration);
4459
+ this.prev = function (current, prev, callback) {
4460
+ current.animate({marginLeft : '100%'}, duration);
3988
4461
  prev.css(margin, '-100%');
3989
- prev.animate(animMargin, duration, function() {
4462
+ prev.animate(animMargin, duration, function () {
3990
4463
  current.css(margin, '100%');
3991
4464
  callback();
3992
4465
  });
3993
4466
  };
3994
4467
  };
3995
4468
 
3996
- var FadeAnimation = function(settings, container) {
4469
+ var FadeAnimation = function (settings, container) {
3997
4470
  var duration = settings.animation_speed;
3998
4471
  var is_rtl = ($('html[dir=rtl]').length === 1);
3999
4472
  var margin = is_rtl ? 'marginRight' : 'marginLeft';
4000
4473
 
4001
- this.next = function(current, next, callback) {
4002
- next.css({'margin':'0%', 'opacity':'0.01'});
4003
- next.animate({'opacity':'1'}, duration, 'linear', function() {
4474
+ this.next = function (current, next, callback) {
4475
+ next.css({'margin' : '0%', 'opacity' : '0.01'});
4476
+ next.animate({'opacity' :'1'}, duration, 'linear', function () {
4004
4477
  current.css('margin', '100%');
4005
4478
  callback();
4006
4479
  });
4007
4480
  };
4008
4481
 
4009
- this.prev = function(current, prev, callback) {
4010
- prev.css({'margin':'0%', 'opacity':'0.01'});
4011
- prev.animate({'opacity':'1'}, duration, 'linear', function() {
4482
+ this.prev = function (current, prev, callback) {
4483
+ prev.css({'margin' : '0%', 'opacity' : '0.01'});
4484
+ prev.animate({'opacity' : '1'}, duration, 'linear', function () {
4012
4485
  current.css('margin', '100%');
4013
4486
  callback();
4014
4487
  });
4015
4488
  };
4016
4489
  };
4017
4490
 
4018
-
4019
4491
  Foundation.libs = Foundation.libs || {};
4020
4492
 
4021
4493
  Foundation.libs.orbit = {
4022
- name: 'orbit',
4023
-
4024
- version: '5.4.7',
4025
-
4026
- settings: {
4027
- animation: 'slide',
4028
- timer_speed: 10000,
4029
- pause_on_hover: true,
4030
- resume_on_mouseout: false,
4031
- next_on_click: true,
4032
- animation_speed: 500,
4033
- stack_on_small: false,
4034
- navigation_arrows: true,
4035
- slide_number: true,
4036
- slide_number_text: 'of',
4037
- container_class: 'orbit-container',
4038
- stack_on_small_class: 'orbit-stack-on-small',
4039
- next_class: 'orbit-next',
4040
- prev_class: 'orbit-prev',
4041
- timer_container_class: 'orbit-timer',
4042
- timer_paused_class: 'paused',
4043
- timer_progress_class: 'orbit-progress',
4044
- slides_container_class: 'orbit-slides-container',
4045
- preloader_class: 'preloader',
4046
- slide_selector: '*',
4047
- bullets_container_class: 'orbit-bullets',
4048
- bullets_active_class: 'active',
4049
- slide_number_class: 'orbit-slide-number',
4050
- caption_class: 'orbit-caption',
4051
- active_slide_class: 'active',
4052
- orbit_transition_class: 'orbit-transitioning',
4053
- bullets: true,
4054
- circular: true,
4055
- timer: true,
4056
- variable_height: false,
4057
- swipe: true,
4058
- before_slide_change: noop,
4059
- after_slide_change: noop
4494
+ name : 'orbit',
4495
+
4496
+ version : '5.5.2',
4497
+
4498
+ settings : {
4499
+ animation : 'slide',
4500
+ timer_speed : 10000,
4501
+ pause_on_hover : true,
4502
+ resume_on_mouseout : false,
4503
+ next_on_click : true,
4504
+ animation_speed : 500,
4505
+ stack_on_small : false,
4506
+ navigation_arrows : true,
4507
+ slide_number : true,
4508
+ slide_number_text : 'of',
4509
+ container_class : 'orbit-container',
4510
+ stack_on_small_class : 'orbit-stack-on-small',
4511
+ next_class : 'orbit-next',
4512
+ prev_class : 'orbit-prev',
4513
+ timer_container_class : 'orbit-timer',
4514
+ timer_paused_class : 'paused',
4515
+ timer_progress_class : 'orbit-progress',
4516
+ slides_container_class : 'orbit-slides-container',
4517
+ preloader_class : 'preloader',
4518
+ slide_selector : '*',
4519
+ bullets_container_class : 'orbit-bullets',
4520
+ bullets_active_class : 'active',
4521
+ slide_number_class : 'orbit-slide-number',
4522
+ caption_class : 'orbit-caption',
4523
+ active_slide_class : 'active',
4524
+ orbit_transition_class : 'orbit-transitioning',
4525
+ bullets : true,
4526
+ circular : true,
4527
+ timer : true,
4528
+ variable_height : false,
4529
+ swipe : true,
4530
+ before_slide_change : noop,
4531
+ after_slide_change : noop
4060
4532
  },
4061
4533
 
4062
4534
  init : function (scope, method, options) {
@@ -4077,7 +4549,7 @@
4077
4549
  var instance = $el.data(self.name + '-instance');
4078
4550
  instance.compute_dimensions();
4079
4551
  } else {
4080
- self.S('[data-orbit]', self.scope).each(function(idx, el) {
4552
+ self.S('[data-orbit]', self.scope).each(function (idx, el) {
4081
4553
  var $el = self.S(el);
4082
4554
  var opts = self.data_options($el);
4083
4555
  var instance = $el.data(self.name + '-instance');
@@ -4087,7 +4559,6 @@
4087
4559
  }
4088
4560
  };
4089
4561
 
4090
-
4091
4562
  }(jQuery, window, window.document));
4092
4563
 
4093
4564
  ;(function ($, window, document, undefined) {
@@ -4096,33 +4567,35 @@
4096
4567
  Foundation.libs.reveal = {
4097
4568
  name : 'reveal',
4098
4569
 
4099
- version : '5.4.7',
4570
+ version : '5.5.2',
4100
4571
 
4101
4572
  locked : false,
4102
4573
 
4103
4574
  settings : {
4104
- animation: 'fadeAndPop',
4105
- animation_speed: 250,
4106
- close_on_background_click: true,
4107
- close_on_esc: true,
4108
- dismiss_modal_class: 'close-reveal-modal',
4109
- bg_class: 'reveal-modal-bg',
4110
- root_element: 'body',
4111
- open: function(){},
4112
- opened: function(){},
4113
- close: function(){},
4114
- closed: function(){},
4575
+ animation : 'fadeAndPop',
4576
+ animation_speed : 250,
4577
+ close_on_background_click : true,
4578
+ close_on_esc : true,
4579
+ dismiss_modal_class : 'close-reveal-modal',
4580
+ multiple_opened : false,
4581
+ bg_class : 'reveal-modal-bg',
4582
+ root_element : 'body',
4583
+ open : function(){},
4584
+ opened : function(){},
4585
+ close : function(){},
4586
+ closed : function(){},
4587
+ on_ajax_error: $.noop,
4115
4588
  bg : $('.reveal-modal-bg'),
4116
4589
  css : {
4117
4590
  open : {
4118
- 'opacity': 0,
4119
- 'visibility': 'visible',
4591
+ 'opacity' : 0,
4592
+ 'visibility' : 'visible',
4120
4593
  'display' : 'block'
4121
4594
  },
4122
4595
  close : {
4123
- 'opacity': 1,
4124
- 'visibility': 'hidden',
4125
- 'display': 'none'
4596
+ 'opacity' : 1,
4597
+ 'visibility' : 'hidden',
4598
+ 'display' : 'none'
4126
4599
  }
4127
4600
  }
4128
4601
  },
@@ -4140,10 +4613,11 @@
4140
4613
  .off('.reveal')
4141
4614
  .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {
4142
4615
  e.preventDefault();
4143
-
4616
+
4144
4617
  if (!self.locked) {
4145
4618
  var element = S(this),
4146
- ajax = element.data(self.data_attr('reveal-ajax'));
4619
+ ajax = element.data(self.data_attr('reveal-ajax')),
4620
+ replaceContentSel = element.data(self.data_attr('reveal-replace-content'));
4147
4621
 
4148
4622
  self.locked = true;
4149
4623
 
@@ -4151,17 +4625,14 @@
4151
4625
  self.open.call(self, element);
4152
4626
  } else {
4153
4627
  var url = ajax === true ? element.attr('href') : ajax;
4154
-
4155
- self.open.call(self, element, {url: url});
4628
+ self.open.call(self, element, {url : url}, { replaceContentSel : replaceContentSel });
4156
4629
  }
4157
4630
  }
4158
4631
  });
4159
4632
 
4160
4633
  S(document)
4161
4634
  .on('click.fndtn.reveal', this.close_targets(), function (e) {
4162
-
4163
4635
  e.preventDefault();
4164
-
4165
4636
  if (!self.locked) {
4166
4637
  var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings,
4167
4638
  bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
@@ -4175,11 +4646,11 @@
4175
4646
  }
4176
4647
 
4177
4648
  self.locked = true;
4178
- self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open') : S(this).closest('[' + self.attr_name() + ']'));
4649
+ self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']'));
4179
4650
  }
4180
4651
  });
4181
4652
 
4182
- if(S('[' + self.attr_name() + ']', this.scope).length > 0) {
4653
+ if (S('[' + self.attr_name() + ']', this.scope).length > 0) {
4183
4654
  S(this.scope)
4184
4655
  // .off('.reveal')
4185
4656
  .on('open.fndtn.reveal', this.settings.open)
@@ -4226,7 +4697,6 @@
4226
4697
  return true;
4227
4698
  },
4228
4699
 
4229
-
4230
4700
  open : function (target, ajax_settings) {
4231
4701
  var self = this,
4232
4702
  modal;
@@ -4260,8 +4730,16 @@
4260
4730
  .data('offset', this.cache_offset(modal));
4261
4731
  }
4262
4732
 
4733
+ modal.attr('tabindex','0').attr('aria-hidden','false');
4734
+
4263
4735
  this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
4264
- modal.trigger('open').trigger('open.fndtn.reveal');
4736
+
4737
+ // Prevent namespace event from triggering twice
4738
+ modal.on('open.fndtn.reveal', function(e) {
4739
+ if (e.namespace !== 'fndtn.reveal') return;
4740
+ });
4741
+
4742
+ modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');
4265
4743
 
4266
4744
  if (open_modal.length < 1) {
4267
4745
  this.toggle_bg(modal, true);
@@ -4269,36 +4747,58 @@
4269
4747
 
4270
4748
  if (typeof ajax_settings === 'string') {
4271
4749
  ajax_settings = {
4272
- url: ajax_settings
4750
+ url : ajax_settings
4273
4751
  };
4274
4752
  }
4275
4753
 
4276
4754
  if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
4277
4755
  if (open_modal.length > 0) {
4278
- this.hide(open_modal, settings.css.close);
4756
+ if (settings.multiple_opened) {
4757
+ self.to_back(open_modal);
4758
+ } else {
4759
+ self.hide(open_modal, settings.css.close);
4760
+ }
4279
4761
  }
4280
4762
 
4281
4763
  this.show(modal, settings.css.open);
4282
4764
  } else {
4283
4765
  var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
4284
-
4285
4766
  $.extend(ajax_settings, {
4286
- success: function (data, textStatus, jqXHR) {
4767
+ success : function (data, textStatus, jqXHR) {
4287
4768
  if ( $.isFunction(old_success) ) {
4288
- old_success(data, textStatus, jqXHR);
4769
+ var result = old_success(data, textStatus, jqXHR);
4770
+ if (typeof result == 'string') {
4771
+ data = result;
4772
+ }
4773
+ }
4774
+
4775
+ if (typeof options !== 'undefined' && typeof options.replaceContentSel !== 'undefined') {
4776
+ modal.find(options.replaceContentSel).html(data);
4777
+ } else {
4778
+ modal.html(data);
4289
4779
  }
4290
4780
 
4291
- modal.html(data);
4292
4781
  self.S(modal).foundation('section', 'reflow');
4293
4782
  self.S(modal).children().foundation();
4294
4783
 
4295
4784
  if (open_modal.length > 0) {
4296
- self.hide(open_modal, settings.css.close);
4785
+ if (settings.multiple_opened) {
4786
+ self.to_back(open_modal);
4787
+ } else {
4788
+ self.hide(open_modal, settings.css.close);
4789
+ }
4297
4790
  }
4298
4791
  self.show(modal, settings.css.open);
4299
4792
  }
4300
4793
  });
4301
4794
 
4795
+ // check for if user initalized with error callback
4796
+ if (settings.on_ajax_error !== $.noop) {
4797
+ $.extend(ajax_settings, {
4798
+ error : settings.on_ajax_error
4799
+ });
4800
+ }
4801
+
4302
4802
  $.ajax(ajax_settings);
4303
4803
  }
4304
4804
  }
@@ -4308,14 +4808,29 @@
4308
4808
  close : function (modal) {
4309
4809
  var modal = modal && modal.length ? modal : this.S(this.scope),
4310
4810
  open_modals = this.S('[' + this.attr_name() + '].open'),
4311
- settings = modal.data(this.attr_name(true) + '-init') || this.settings;
4811
+ settings = modal.data(this.attr_name(true) + '-init') || this.settings,
4812
+ self = this;
4312
4813
 
4313
4814
  if (open_modals.length > 0) {
4815
+
4816
+ modal.removeAttr('tabindex','0').attr('aria-hidden','true');
4817
+
4314
4818
  this.locked = true;
4315
4819
  this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open
4316
- modal.trigger('close').trigger('close.fndtn.reveal');
4317
- this.toggle_bg(modal, false);
4318
- this.hide(open_modals, settings.css.close, settings);
4820
+
4821
+ modal.trigger('close.fndtn.reveal');
4822
+
4823
+ if ((settings.multiple_opened && open_modals.length === 1) || !settings.multiple_opened || modal.length > 1) {
4824
+ self.toggle_bg(modal, false);
4825
+ self.to_front(modal);
4826
+ }
4827
+
4828
+ if (settings.multiple_opened) {
4829
+ self.hide(modal, settings.css.close, settings);
4830
+ self.to_front($($.makeArray(open_modals).reverse()[1]));
4831
+ } else {
4832
+ self.hide(open_modals, settings.css.close, settings);
4833
+ }
4319
4834
  }
4320
4835
  },
4321
4836
 
@@ -4349,12 +4864,13 @@
4349
4864
  // is modal
4350
4865
  if (css) {
4351
4866
  var settings = el.data(this.attr_name(true) + '-init') || this.settings,
4352
- root_element = settings.root_element;
4867
+ root_element = settings.root_element,
4868
+ context = this;
4353
4869
 
4354
4870
  if (el.parent(root_element).length === 0) {
4355
4871
  var placeholder = el.wrap('<div style="display: none;" />').parent();
4356
4872
 
4357
- el.on('closed.fndtn.reveal.wrapped', function() {
4873
+ el.on('closed.fndtn.reveal.wrapped', function () {
4358
4874
  el.detach().appendTo(placeholder);
4359
4875
  el.unwrap().unbind('closed.fndtn.reveal.wrapped');
4360
4876
  });
@@ -4377,11 +4893,11 @@
4377
4893
  return el
4378
4894
  .css(css)
4379
4895
  .animate(end_css, settings.animation_speed, 'linear', function () {
4380
- this.locked = false;
4381
- el.trigger('opened').trigger('opened.fndtn.reveal');
4382
- }.bind(this))
4896
+ context.locked = false;
4897
+ el.trigger('opened.fndtn.reveal');
4898
+ })
4383
4899
  .addClass('open');
4384
- }.bind(this), settings.animation_speed / 2);
4900
+ }, settings.animation_speed / 2);
4385
4901
  }
4386
4902
 
4387
4903
  if (animData.fade) {
@@ -4392,14 +4908,14 @@
4392
4908
  return el
4393
4909
  .css(css)
4394
4910
  .animate(end_css, settings.animation_speed, 'linear', function () {
4395
- this.locked = false;
4396
- el.trigger('opened').trigger('opened.fndtn.reveal');
4397
- }.bind(this))
4911
+ context.locked = false;
4912
+ el.trigger('opened.fndtn.reveal');
4913
+ })
4398
4914
  .addClass('open');
4399
- }.bind(this), settings.animation_speed / 2);
4915
+ }, settings.animation_speed / 2);
4400
4916
  }
4401
4917
 
4402
- return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened').trigger('opened.fndtn.reveal');
4918
+ return el.css(css).show().css({opacity : 1}).addClass('open').trigger('opened.fndtn.reveal');
4403
4919
  }
4404
4920
 
4405
4921
  var settings = this.settings;
@@ -4414,10 +4930,19 @@
4414
4930
  return el.show();
4415
4931
  },
4416
4932
 
4933
+ to_back : function(el) {
4934
+ el.addClass('toback');
4935
+ },
4936
+
4937
+ to_front : function(el) {
4938
+ el.removeClass('toback');
4939
+ },
4940
+
4417
4941
  hide : function (el, css) {
4418
4942
  // is modal
4419
4943
  if (css) {
4420
- var settings = el.data(this.attr_name(true) + '-init');
4944
+ var settings = el.data(this.attr_name(true) + '-init'),
4945
+ context = this;
4421
4946
  settings = settings || this.settings;
4422
4947
 
4423
4948
  var animData = getAnimationData(settings.animation);
@@ -4433,27 +4958,27 @@
4433
4958
  return setTimeout(function () {
4434
4959
  return el
4435
4960
  .animate(end_css, settings.animation_speed, 'linear', function () {
4436
- this.locked = false;
4437
- el.css(css).trigger('closed').trigger('closed.fndtn.reveal');
4438
- }.bind(this))
4961
+ context.locked = false;
4962
+ el.css(css).trigger('closed.fndtn.reveal');
4963
+ })
4439
4964
  .removeClass('open');
4440
- }.bind(this), settings.animation_speed / 2);
4965
+ }, settings.animation_speed / 2);
4441
4966
  }
4442
4967
 
4443
4968
  if (animData.fade) {
4444
- var end_css = {opacity: 0};
4969
+ var end_css = {opacity : 0};
4445
4970
 
4446
4971
  return setTimeout(function () {
4447
4972
  return el
4448
4973
  .animate(end_css, settings.animation_speed, 'linear', function () {
4449
- this.locked = false;
4450
- el.css(css).trigger('closed').trigger('closed.fndtn.reveal');
4451
- }.bind(this))
4974
+ context.locked = false;
4975
+ el.css(css).trigger('closed.fndtn.reveal');
4976
+ })
4452
4977
  .removeClass('open');
4453
- }.bind(this), settings.animation_speed / 2);
4978
+ }, settings.animation_speed / 2);
4454
4979
  }
4455
4980
 
4456
- return el.hide().css(css).removeClass('open').trigger('closed').trigger('closed.fndtn.reveal');
4981
+ return el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal');
4457
4982
  }
4458
4983
 
4459
4984
  var settings = this.settings;
@@ -4494,7 +5019,7 @@
4494
5019
  }
4495
5020
  },
4496
5021
 
4497
- data_attr: function (str) {
5022
+ data_attr : function (str) {
4498
5023
  if (this.namespace.length > 0) {
4499
5024
  return this.namespace + '-' + str;
4500
5025
  }
@@ -4503,7 +5028,7 @@
4503
5028
  },
4504
5029
 
4505
5030
  cache_offset : function (modal) {
4506
- var offset = modal.show().height() + parseInt(modal.css('top'), 10);
5031
+ var offset = modal.show().height() + parseInt(modal.css('top'), 10) + modal.scrollY;
4507
5032
 
4508
5033
  modal.hide();
4509
5034
 
@@ -4528,9 +5053,9 @@
4528
5053
  var fade = /fade/i.test(str);
4529
5054
  var pop = /pop/i.test(str);
4530
5055
  return {
4531
- animate: fade || pop,
4532
- pop: pop,
4533
- fade: fade
5056
+ animate : fade || pop,
5057
+ pop : pop,
5058
+ fade : fade
4534
5059
  };
4535
5060
  }
4536
5061
  }(jQuery, window, window.document));
@@ -4541,39 +5066,41 @@
4541
5066
  Foundation.libs.slider = {
4542
5067
  name : 'slider',
4543
5068
 
4544
- version : '5.4.7',
5069
+ version : '5.5.2',
4545
5070
 
4546
- settings: {
4547
- start: 0,
4548
- end: 100,
4549
- step: 1,
4550
- initial: null,
4551
- display_selector: '',
4552
- vertical: false,
4553
- on_change: function(){}
5071
+ settings : {
5072
+ start : 0,
5073
+ end : 100,
5074
+ step : 1,
5075
+ precision : null,
5076
+ initial : null,
5077
+ display_selector : '',
5078
+ vertical : false,
5079
+ trigger_input_change : false,
5080
+ on_change : function () {}
4554
5081
  },
4555
5082
 
4556
5083
  cache : {},
4557
5084
 
4558
5085
  init : function (scope, method, options) {
4559
- Foundation.inherit(this,'throttle');
5086
+ Foundation.inherit(this, 'throttle');
4560
5087
  this.bindings(method, options);
4561
5088
  this.reflow();
4562
5089
  },
4563
5090
 
4564
- events : function() {
5091
+ events : function () {
4565
5092
  var self = this;
4566
5093
 
4567
5094
  $(this.scope)
4568
5095
  .off('.slider')
4569
5096
  .on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',
4570
- '[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-handle', function(e) {
5097
+ '[' + self.attr_name() + ']:not(.disabled, [disabled]) .range-slider-handle', function (e) {
4571
5098
  if (!self.cache.active) {
4572
5099
  e.preventDefault();
4573
5100
  self.set_active_slider($(e.target));
4574
5101
  }
4575
5102
  })
4576
- .on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function(e) {
5103
+ .on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function (e) {
4577
5104
  if (!!self.cache.active) {
4578
5105
  e.preventDefault();
4579
5106
  if ($.data(self.cache.active[0], 'settings').vertical) {
@@ -4581,41 +5108,70 @@
4581
5108
  if (!e.pageY) {
4582
5109
  scroll_offset = window.scrollY;
4583
5110
  }
4584
- self.calculate_position(self.cache.active, (e.pageY ||
4585
- e.originalEvent.clientY ||
4586
- e.originalEvent.touches[0].clientY ||
4587
- e.currentPoint.y)
4588
- + scroll_offset);
5111
+ self.calculate_position(self.cache.active, self.get_cursor_position(e, 'y') + scroll_offset);
4589
5112
  } else {
4590
- self.calculate_position(self.cache.active, e.pageX ||
4591
- e.originalEvent.clientX ||
4592
- e.originalEvent.touches[0].clientX ||
4593
- e.currentPoint.x);
5113
+ self.calculate_position(self.cache.active, self.get_cursor_position(e, 'x'));
4594
5114
  }
4595
5115
  }
4596
5116
  })
4597
- .on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function(e) {
5117
+ .on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function (e) {
4598
5118
  self.remove_active_slider();
4599
5119
  })
4600
- .on('change.fndtn.slider', function(e) {
5120
+ .on('change.fndtn.slider', function (e) {
4601
5121
  self.settings.on_change();
4602
5122
  });
4603
5123
 
4604
5124
  self.S(window)
4605
- .on('resize.fndtn.slider', self.throttle(function(e) {
5125
+ .on('resize.fndtn.slider', self.throttle(function (e) {
4606
5126
  self.reflow();
4607
5127
  }, 300));
5128
+
5129
+ // update slider value as users change input value
5130
+ this.S('[' + this.attr_name() + ']').each(function () {
5131
+ var slider = $(this),
5132
+ handle = slider.children('.range-slider-handle')[0],
5133
+ settings = self.initialize_settings(handle);
5134
+
5135
+ if (settings.display_selector != '') {
5136
+ $(settings.display_selector).each(function(){
5137
+ if (this.hasOwnProperty('value')) {
5138
+ $(this).change(function(){
5139
+ // is there a better way to do this?
5140
+ slider.foundation("slider", "set_value", $(this).val());
5141
+ });
5142
+ }
5143
+ });
5144
+ }
5145
+ });
5146
+ },
5147
+
5148
+ get_cursor_position : function (e, xy) {
5149
+ var pageXY = 'page' + xy.toUpperCase(),
5150
+ clientXY = 'client' + xy.toUpperCase(),
5151
+ position;
5152
+
5153
+ if (typeof e[pageXY] !== 'undefined') {
5154
+ position = e[pageXY];
5155
+ } else if (typeof e.originalEvent[clientXY] !== 'undefined') {
5156
+ position = e.originalEvent[clientXY];
5157
+ } else if (e.originalEvent.touches && e.originalEvent.touches[0] && typeof e.originalEvent.touches[0][clientXY] !== 'undefined') {
5158
+ position = e.originalEvent.touches[0][clientXY];
5159
+ } else if (e.currentPoint && typeof e.currentPoint[xy] !== 'undefined') {
5160
+ position = e.currentPoint[xy];
5161
+ }
5162
+
5163
+ return position;
4608
5164
  },
4609
5165
 
4610
- set_active_slider : function($handle) {
5166
+ set_active_slider : function ($handle) {
4611
5167
  this.cache.active = $handle;
4612
5168
  },
4613
5169
 
4614
- remove_active_slider : function() {
5170
+ remove_active_slider : function () {
4615
5171
  this.cache.active = null;
4616
5172
  },
4617
5173
 
4618
- calculate_position : function($handle, cursor_x) {
5174
+ calculate_position : function ($handle, cursor_x) {
4619
5175
  var self = this,
4620
5176
  settings = $.data($handle[0], 'settings'),
4621
5177
  handle_l = $.data($handle[0], 'handle_l'),
@@ -4623,30 +5179,32 @@
4623
5179
  bar_l = $.data($handle[0], 'bar_l'),
4624
5180
  bar_o = $.data($handle[0], 'bar_o');
4625
5181
 
4626
- requestAnimationFrame(function(){
5182
+ requestAnimationFrame(function () {
4627
5183
  var pct;
4628
5184
 
4629
5185
  if (Foundation.rtl && !settings.vertical) {
4630
- pct = self.limit_to(((bar_o+bar_l-cursor_x)/bar_l),0,1);
5186
+ pct = self.limit_to(((bar_o + bar_l - cursor_x) / bar_l), 0, 1);
4631
5187
  } else {
4632
- pct = self.limit_to(((cursor_x-bar_o)/bar_l),0,1);
5188
+ pct = self.limit_to(((cursor_x - bar_o) / bar_l), 0, 1);
4633
5189
  }
4634
5190
 
4635
- pct = settings.vertical ? 1-pct : pct;
5191
+ pct = settings.vertical ? 1 - pct : pct;
4636
5192
 
4637
- var norm = self.normalized_value(pct, settings.start, settings.end, settings.step);
5193
+ var norm = self.normalized_value(pct, settings.start, settings.end, settings.step, settings.precision);
4638
5194
 
4639
5195
  self.set_ui($handle, norm);
4640
5196
  });
4641
5197
  },
4642
5198
 
4643
- set_ui : function($handle, value) {
5199
+ set_ui : function ($handle, value) {
4644
5200
  var settings = $.data($handle[0], 'settings'),
4645
5201
  handle_l = $.data($handle[0], 'handle_l'),
4646
5202
  bar_l = $.data($handle[0], 'bar_l'),
4647
5203
  norm_pct = this.normalized_percentage(value, settings.start, settings.end),
4648
- handle_offset = norm_pct*(bar_l-handle_l)-1,
4649
- progress_bar_length = norm_pct*100;
5204
+ handle_offset = norm_pct * (bar_l - handle_l) - 1,
5205
+ progress_bar_length = norm_pct * 100,
5206
+ $handle_parent = $handle.parent(),
5207
+ $hidden_inputs = $handle.parent().children('input[type=hidden]');
4650
5208
 
4651
5209
  if (Foundation.rtl && !settings.vertical) {
4652
5210
  handle_offset = -handle_offset;
@@ -4661,21 +5219,24 @@
4661
5219
  $handle.siblings('.range-slider-active-segment').css('width', progress_bar_length + '%');
4662
5220
  }
4663
5221
 
4664
- $handle.parent().attr(this.attr_name(), value).trigger('change').trigger('change.fndtn.slider');
5222
+ $handle_parent.attr(this.attr_name(), value).trigger('change.fndtn.slider');
4665
5223
 
4666
- $handle.parent().children('input[type=hidden]').val(value);
5224
+ $hidden_inputs.val(value);
5225
+ if (settings.trigger_input_change) {
5226
+ $hidden_inputs.trigger('change.fndtn.slider');
5227
+ }
4667
5228
 
4668
5229
  if (!$handle[0].hasAttribute('aria-valuemin')) {
4669
5230
  $handle.attr({
4670
- 'aria-valuemin': settings.start,
4671
- 'aria-valuemax': settings.end,
5231
+ 'aria-valuemin' : settings.start,
5232
+ 'aria-valuemax' : settings.end
4672
5233
  });
4673
5234
  }
4674
5235
  $handle.attr('aria-valuenow', value);
4675
5236
 
4676
5237
  if (settings.display_selector != '') {
4677
- $(settings.display_selector).each(function(){
4678
- if (this.hasOwnProperty('value')) {
5238
+ $(settings.display_selector).each(function () {
5239
+ if (this.hasAttribute('value')) {
4679
5240
  $(this).val(value);
4680
5241
  } else {
4681
5242
  $(this).text(value);
@@ -4685,43 +5246,49 @@
4685
5246
 
4686
5247
  },
4687
5248
 
4688
- normalized_percentage : function(val, start, end) {
4689
- return Math.min(1, (val - start)/(end - start));
5249
+ normalized_percentage : function (val, start, end) {
5250
+ return Math.min(1, (val - start) / (end - start));
4690
5251
  },
4691
5252
 
4692
- normalized_value : function(val, start, end, step) {
5253
+ normalized_value : function (val, start, end, step, precision) {
4693
5254
  var range = end - start,
4694
- point = val*range,
4695
- mod = (point-(point%step)) / step,
5255
+ point = val * range,
5256
+ mod = (point - (point % step)) / step,
4696
5257
  rem = point % step,
4697
- round = ( rem >= step*0.5 ? step : 0);
4698
- return (mod*step + round) + start;
5258
+ round = ( rem >= step * 0.5 ? step : 0);
5259
+ return ((mod * step + round) + start).toFixed(precision);
4699
5260
  },
4700
5261
 
4701
- set_translate : function(ele, offset, vertical) {
5262
+ set_translate : function (ele, offset, vertical) {
4702
5263
  if (vertical) {
4703
5264
  $(ele)
4704
- .css('-webkit-transform', 'translateY('+offset+'px)')
4705
- .css('-moz-transform', 'translateY('+offset+'px)')
4706
- .css('-ms-transform', 'translateY('+offset+'px)')
4707
- .css('-o-transform', 'translateY('+offset+'px)')
4708
- .css('transform', 'translateY('+offset+'px)');
5265
+ .css('-webkit-transform', 'translateY(' + offset + 'px)')
5266
+ .css('-moz-transform', 'translateY(' + offset + 'px)')
5267
+ .css('-ms-transform', 'translateY(' + offset + 'px)')
5268
+ .css('-o-transform', 'translateY(' + offset + 'px)')
5269
+ .css('transform', 'translateY(' + offset + 'px)');
4709
5270
  } else {
4710
5271
  $(ele)
4711
- .css('-webkit-transform', 'translateX('+offset+'px)')
4712
- .css('-moz-transform', 'translateX('+offset+'px)')
4713
- .css('-ms-transform', 'translateX('+offset+'px)')
4714
- .css('-o-transform', 'translateX('+offset+'px)')
4715
- .css('transform', 'translateX('+offset+'px)');
5272
+ .css('-webkit-transform', 'translateX(' + offset + 'px)')
5273
+ .css('-moz-transform', 'translateX(' + offset + 'px)')
5274
+ .css('-ms-transform', 'translateX(' + offset + 'px)')
5275
+ .css('-o-transform', 'translateX(' + offset + 'px)')
5276
+ .css('transform', 'translateX(' + offset + 'px)');
4716
5277
  }
4717
5278
  },
4718
5279
 
4719
- limit_to : function(val, min, max) {
5280
+ limit_to : function (val, min, max) {
4720
5281
  return Math.min(Math.max(val, min), max);
4721
5282
  },
4722
5283
 
4723
- initialize_settings : function(handle) {
4724
- var settings = $.extend({}, this.settings, this.data_options($(handle).parent()));
5284
+ initialize_settings : function (handle) {
5285
+ var settings = $.extend({}, this.settings, this.data_options($(handle).parent())),
5286
+ decimal_places_match_result;
5287
+
5288
+ if (settings.precision === null) {
5289
+ decimal_places_match_result = ('' + settings.step).match(/\.([\d]*)/);
5290
+ settings.precision = decimal_places_match_result && decimal_places_match_result[1] ? decimal_places_match_result[1].length : 0;
5291
+ }
4725
5292
 
4726
5293
  if (settings.vertical) {
4727
5294
  $.data(handle, 'bar_o', $(handle).parent().offset().top);
@@ -4736,19 +5303,19 @@
4736
5303
  }
4737
5304
 
4738
5305
  $.data(handle, 'bar', $(handle).parent());
4739
- $.data(handle, 'settings', settings);
5306
+ return $.data(handle, 'settings', settings);
4740
5307
  },
4741
5308
 
4742
- set_initial_position : function($ele) {
5309
+ set_initial_position : function ($ele) {
4743
5310
  var settings = $.data($ele.children('.range-slider-handle')[0], 'settings'),
4744
- initial = (!!settings.initial ? settings.initial : Math.floor((settings.end-settings.start)*0.5/settings.step)*settings.step+settings.start),
5311
+ initial = ((typeof settings.initial == 'number' && !isNaN(settings.initial)) ? settings.initial : Math.floor((settings.end - settings.start) * 0.5 / settings.step) * settings.step + settings.start),
4745
5312
  $handle = $ele.children('.range-slider-handle');
4746
5313
  this.set_ui($handle, initial);
4747
5314
  },
4748
5315
 
4749
- set_value : function(value) {
5316
+ set_value : function (value) {
4750
5317
  var self = this;
4751
- $('[' + self.attr_name() + ']', this.scope).each(function(){
5318
+ $('[' + self.attr_name() + ']', this.scope).each(function () {
4752
5319
  $(this).attr(self.attr_name(), value);
4753
5320
  });
4754
5321
  if (!!$(this.scope).attr(self.attr_name())) {
@@ -4757,9 +5324,9 @@
4757
5324
  self.reflow();
4758
5325
  },
4759
5326
 
4760
- reflow : function() {
5327
+ reflow : function () {
4761
5328
  var self = this;
4762
- self.S('[' + this.attr_name() + ']').each(function() {
5329
+ self.S('[' + this.attr_name() + ']').each(function () {
4763
5330
  var handle = $(this).children('.range-slider-handle')[0],
4764
5331
  val = $(this).attr(self.attr_name());
4765
5332
  self.initialize_settings(handle);
@@ -4781,55 +5348,74 @@
4781
5348
  Foundation.libs.tab = {
4782
5349
  name : 'tab',
4783
5350
 
4784
- version : '5.4.7',
5351
+ version : '5.5.2',
4785
5352
 
4786
5353
  settings : {
4787
- active_class: 'active',
5354
+ active_class : 'active',
4788
5355
  callback : function () {},
4789
- deep_linking: false,
4790
- scroll_to_content: true,
4791
- is_hover: false
5356
+ deep_linking : false,
5357
+ scroll_to_content : true,
5358
+ is_hover : false
4792
5359
  },
4793
5360
 
4794
- default_tab_hashes: [],
5361
+ default_tab_hashes : [],
4795
5362
 
4796
5363
  init : function (scope, method, options) {
4797
5364
  var self = this,
4798
5365
  S = this.S;
4799
5366
 
5367
+ // Store the default active tabs which will be referenced when the
5368
+ // location hash is absent, as in the case of navigating the tabs and
5369
+ // returning to the first viewing via the browser Back button.
5370
+ S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {
5371
+ self.default_tab_hashes.push(this.hash);
5372
+ });
5373
+
5374
+ // store the initial href, which is used to allow correct behaviour of the
5375
+ // browser back button when deep linking is turned on.
5376
+ self.entry_location = window.location.href;
5377
+
4800
5378
  this.bindings(method, options);
4801
5379
  this.handle_location_hash_change();
4802
-
4803
- // Store the default active tabs which will be referenced when the
4804
- // location hash is absent, as in the case of navigating the tabs and
4805
- // returning to the first viewing via the browser Back button.
4806
- S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () {
4807
- self.default_tab_hashes.push(this.hash);
4808
- });
4809
5380
  },
4810
5381
 
4811
5382
  events : function () {
4812
5383
  var self = this,
4813
5384
  S = this.S;
4814
5385
 
4815
- var usual_tab_behavior = function (e) {
4816
- var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init');
5386
+ var usual_tab_behavior = function (e, target) {
5387
+ var settings = S(target).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');
4817
5388
  if (!settings.is_hover || Modernizr.touch) {
4818
5389
  e.preventDefault();
4819
5390
  e.stopPropagation();
4820
- self.toggle_active_tab(S(this).parent());
5391
+ self.toggle_active_tab(S(target).parent());
4821
5392
  }
4822
5393
  };
4823
5394
 
4824
5395
  S(this.scope)
4825
5396
  .off('.tab')
5397
+ // Key event: focus/tab key
5398
+ .on('keydown.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
5399
+ var el = this;
5400
+ var keyCode = e.keyCode || e.which;
5401
+ // if user pressed tab key
5402
+ if (keyCode == 9) {
5403
+ e.preventDefault();
5404
+ // TODO: Change usual_tab_behavior into accessibility function?
5405
+ usual_tab_behavior(e, el);
5406
+ }
5407
+ })
4826
5408
  // Click event: tab title
4827
- .on('focus.fndtn.tab', '[' + this.attr_name() + '] > * > a', usual_tab_behavior )
4828
- .on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', usual_tab_behavior )
5409
+ .on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', function(e) {
5410
+ var el = this;
5411
+ usual_tab_behavior(e, el);
5412
+ })
4829
5413
  // Hover event: tab title
4830
5414
  .on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) {
4831
- var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init');
4832
- if (settings.is_hover) self.toggle_active_tab(S(this).parent());
5415
+ var settings = S(this).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init');
5416
+ if (settings.is_hover) {
5417
+ self.toggle_active_tab(S(this).parent());
5418
+ }
4833
5419
  });
4834
5420
 
4835
5421
  // Location hash change event
@@ -4880,8 +5466,9 @@
4880
5466
  });
4881
5467
  },
4882
5468
 
4883
- toggle_active_tab: function (tab, location_hash) {
4884
- var S = this.S,
5469
+ toggle_active_tab : function (tab, location_hash) {
5470
+ var self = this,
5471
+ S = self.S,
4885
5472
  tabs = tab.closest('[' + this.attr_name() + ']'),
4886
5473
  tab_link = tab.find('a'),
4887
5474
  anchor = tab.children('a').first(),
@@ -4889,7 +5476,7 @@
4889
5476
  target = S(target_hash),
4890
5477
  siblings = tab.siblings(),
4891
5478
  settings = tabs.data(this.attr_name(true) + '-init'),
4892
- interpret_keyup_action = function(e) {
5479
+ interpret_keyup_action = function (e) {
4893
5480
  // Light modification of Heydon Pickering's Practical ARIA Examples: http://heydonworks.com/practical_aria_examples/js/a11y.js
4894
5481
 
4895
5482
  // define current, previous and next (possible) tabs
@@ -4934,19 +5521,31 @@
4934
5521
  $('#' + $(document.activeElement).attr('href').substring(1))
4935
5522
  .attr('aria-hidden', null);
4936
5523
 
5524
+ },
5525
+ go_to_hash = function(hash) {
5526
+ // This function allows correct behaviour of the browser's back button when deep linking is enabled. Without it
5527
+ // the user would get continually redirected to the default hash.
5528
+ var is_entry_location = window.location.href === self.entry_location,
5529
+ default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : is_entry_location ? window.location.hash :'fndtn-' + self.default_tab_hashes[0].replace('#', '')
5530
+
5531
+ if (!(is_entry_location && hash === default_hash)) {
5532
+ window.location.hash = hash;
5533
+ }
4937
5534
  };
4938
5535
 
4939
5536
  // allow usage of data-tab-content attribute instead of href
4940
- if (S(this).data(this.data_attr('tab-content'))) {
4941
- target_hash = '#' + S(this).data(this.data_attr('tab-content')).split('#')[1];
5537
+ if (anchor.data('tab-content')) {
5538
+ target_hash = '#' + anchor.data('tab-content').split('#')[1];
4942
5539
  target = S(target_hash);
4943
5540
  }
4944
5541
 
4945
5542
  if (settings.deep_linking) {
4946
5543
 
4947
5544
  if (settings.scroll_to_content) {
5545
+
4948
5546
  // retain current hash to scroll to content
4949
- window.location.hash = location_hash || target_hash;
5547
+ go_to_hash(location_hash || target_hash);
5548
+
4950
5549
  if (location_hash == undefined || location_hash == target_hash) {
4951
5550
  tab.parent()[0].scrollIntoView();
4952
5551
  } else {
@@ -4955,9 +5554,9 @@
4955
5554
  } else {
4956
5555
  // prefix the hashes so that the browser doesn't scroll down
4957
5556
  if (location_hash != undefined) {
4958
- window.location.hash = 'fndtn-' + location_hash.replace('#', '');
5557
+ go_to_hash('fndtn-' + location_hash.replace('#', ''));
4959
5558
  } else {
4960
- window.location.hash = 'fndtn-' + target_hash.replace('#', '');
5559
+ go_to_hash('fndtn-' + target_hash.replace('#', ''));
4961
5560
  }
4962
5561
  }
4963
5562
  }
@@ -4967,19 +5566,19 @@
4967
5566
  // window (notably in Chrome).
4968
5567
  // Clean up multiple attr instances to done once
4969
5568
  tab.addClass(settings.active_class).triggerHandler('opened');
4970
- tab_link.attr({"aria-selected": "true", tabindex: 0});
5569
+ tab_link.attr({'aria-selected' : 'true', tabindex : 0});
4971
5570
  siblings.removeClass(settings.active_class)
4972
- siblings.find('a').attr({"aria-selected": "false", tabindex: -1});
4973
- target.siblings().removeClass(settings.active_class).attr({"aria-hidden": "true", tabindex: -1});
4974
- target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr("tabindex");
5571
+ siblings.find('a').attr({'aria-selected' : 'false', tabindex : -1});
5572
+ target.siblings().removeClass(settings.active_class).attr({'aria-hidden' : 'true', tabindex : -1});
5573
+ target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr('tabindex');
4975
5574
  settings.callback(tab);
4976
- target.triggerHandler('toggled', [tab]);
4977
- tabs.triggerHandler('toggled', [target]);
5575
+ target.triggerHandler('toggled', [target]);
5576
+ tabs.triggerHandler('toggled', [tab]);
4978
5577
 
4979
5578
  tab_link.off('keydown').on('keydown', interpret_keyup_action );
4980
5579
  },
4981
5580
 
4982
- data_attr: function (str) {
5581
+ data_attr : function (str) {
4983
5582
  if (this.namespace.length > 0) {
4984
5583
  return this.namespace + '-' + str;
4985
5584
  }
@@ -4999,15 +5598,15 @@
4999
5598
  Foundation.libs.tooltip = {
5000
5599
  name : 'tooltip',
5001
5600
 
5002
- version : '5.4.7',
5601
+ version : '5.5.2',
5003
5602
 
5004
5603
  settings : {
5005
5604
  additional_inheritable_classes : [],
5006
5605
  tooltip_class : '.tooltip',
5007
- append_to: 'body',
5008
- touch_close_text: 'Tap To Close',
5009
- disable_for_touch: false,
5010
- hover_delay: 200,
5606
+ append_to : 'body',
5607
+ touch_close_text : 'Tap To Close',
5608
+ disable_for_touch : false,
5609
+ hover_delay : 200,
5011
5610
  show_on : 'all',
5012
5611
  tip_template : function (selector, content) {
5013
5612
  return '<span data-selector="' + selector + '" id="' + selector + '" class="'
@@ -5023,7 +5622,7 @@
5023
5622
  this.bindings(method, options);
5024
5623
  },
5025
5624
 
5026
- should_show: function (target, tip) {
5625
+ should_show : function (target, tip) {
5027
5626
  var settings = $.extend({}, this.settings, this.data_options(target));
5028
5627
 
5029
5628
  if (settings.show_on === 'all') {
@@ -5052,6 +5651,31 @@
5052
5651
 
5053
5652
  self.create(this.S(instance));
5054
5653
 
5654
+ function _startShow(elt, $this, immediate) {
5655
+ if (elt.timer) {
5656
+ return;
5657
+ }
5658
+
5659
+ if (immediate) {
5660
+ elt.timer = null;
5661
+ self.showTip($this);
5662
+ } else {
5663
+ elt.timer = setTimeout(function () {
5664
+ elt.timer = null;
5665
+ self.showTip($this);
5666
+ }.bind(elt), self.settings.hover_delay);
5667
+ }
5668
+ }
5669
+
5670
+ function _startHide(elt, $this) {
5671
+ if (elt.timer) {
5672
+ clearTimeout(elt.timer);
5673
+ elt.timer = null;
5674
+ }
5675
+
5676
+ self.hide($this);
5677
+ }
5678
+
5055
5679
  $(this.scope)
5056
5680
  .off('.tooltip')
5057
5681
  .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip',
@@ -5064,46 +5688,54 @@
5064
5688
  return false;
5065
5689
  }
5066
5690
 
5067
- if (/mouse/i.test(e.type) && self.ie_touch(e)) return false;
5068
-
5691
+ if (/mouse/i.test(e.type) && self.ie_touch(e)) {
5692
+ return false;
5693
+ }
5694
+
5069
5695
  if ($this.hasClass('open')) {
5070
- if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) e.preventDefault();
5696
+ if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
5697
+ e.preventDefault();
5698
+ }
5071
5699
  self.hide($this);
5072
5700
  } else {
5073
5701
  if (settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
5074
5702
  return;
5075
- } else if(!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
5703
+ } else if (!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) {
5076
5704
  e.preventDefault();
5077
5705
  S(settings.tooltip_class + '.open').hide();
5078
5706
  is_touch = true;
5707
+ // close other open tooltips on touch
5708
+ if ($('.open[' + self.attr_name() + ']').length > 0) {
5709
+ var prevOpen = S($('.open[' + self.attr_name() + ']')[0]);
5710
+ self.hide(prevOpen);
5711
+ }
5079
5712
  }
5080
5713
 
5081
5714
  if (/enter|over/i.test(e.type)) {
5082
- this.timer = setTimeout(function () {
5083
- var tip = self.showTip($this);
5084
- }.bind(this), self.settings.hover_delay);
5715
+ _startShow(this, $this);
5716
+
5085
5717
  } else if (e.type === 'mouseout' || e.type === 'mouseleave') {
5086
- clearTimeout(this.timer);
5087
- self.hide($this);
5718
+ _startHide(this, $this);
5088
5719
  } else {
5089
- self.showTip($this);
5720
+ _startShow(this, $this, true);
5090
5721
  }
5091
5722
  }
5092
5723
  })
5093
5724
  .on('mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', '[' + this.attr_name() + '].open', function (e) {
5094
- if (/mouse/i.test(e.type) && self.ie_touch(e)) return false;
5725
+ if (/mouse/i.test(e.type) && self.ie_touch(e)) {
5726
+ return false;
5727
+ }
5095
5728
 
5096
- if($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {
5729
+ if ($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') {
5097
5730
  return;
5098
- }
5099
- else if($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
5731
+ } else if ($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) {
5100
5732
  self.convert_to_touch($(this));
5101
5733
  } else {
5102
- self.hide($(this));
5734
+ _startHide(this, $(this));
5103
5735
  }
5104
5736
  })
5105
5737
  .on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) {
5106
- self.hide(S(this));
5738
+ _startHide(this, S(this));
5107
5739
  });
5108
5740
  },
5109
5741
 
@@ -5114,7 +5746,7 @@
5114
5746
 
5115
5747
  showTip : function ($target) {
5116
5748
  var $tip = this.getTip($target);
5117
- if (this.should_show($target, $tip)){
5749
+ if (this.should_show($target, $tip)) {
5118
5750
  return this.show($target);
5119
5751
  }
5120
5752
  return;
@@ -5133,17 +5765,16 @@
5133
5765
  },
5134
5766
 
5135
5767
  selector : function ($target) {
5136
- var id = $target.attr('id'),
5137
- dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
5768
+ var dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector');
5138
5769
 
5139
- if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') {
5770
+ if (typeof dataSelector != 'string') {
5140
5771
  dataSelector = this.random_str(6);
5141
5772
  $target
5142
5773
  .attr('data-selector', dataSelector)
5143
5774
  .attr('aria-describedby', dataSelector);
5144
5775
  }
5145
5776
 
5146
- return (id && id.length > 0) ? id : dataSelector;
5777
+ return dataSelector;
5147
5778
  },
5148
5779
 
5149
5780
  create : function ($target) {
@@ -5161,13 +5792,13 @@
5161
5792
  $tip.addClass(classes).appendTo(settings.append_to);
5162
5793
 
5163
5794
  if (Modernizr.touch) {
5164
- $tip.append('<span class="tap-to-close">'+settings.touch_close_text+'</span>');
5165
- $tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function(e) {
5795
+ $tip.append('<span class="tap-to-close">' + settings.touch_close_text + '</span>');
5796
+ $tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function (e) {
5166
5797
  self.hide($target);
5167
5798
  });
5168
5799
  }
5169
5800
 
5170
- $target.removeAttr('title').attr('title','');
5801
+ $target.removeAttr('title').attr('title', '');
5171
5802
  },
5172
5803
 
5173
5804
  reposition : function (target, tip, classes) {
@@ -5181,7 +5812,7 @@
5181
5812
  nubWidth = nub.outerHeight();
5182
5813
 
5183
5814
  if (this.small()) {
5184
- tip.css({'width' : '100%' });
5815
+ tip.css({'width' : '100%'});
5185
5816
  } else {
5186
5817
  tip.css({'width' : (width) ? width : 'auto'});
5187
5818
  }
@@ -5207,10 +5838,18 @@
5207
5838
  nub.addClass('rtl');
5208
5839
  left = target.offset().left + target.outerWidth() - tip.outerWidth();
5209
5840
  }
5841
+
5210
5842
  objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left);
5843
+ // reset nub from small styles, if they've been applied
5844
+ if (nub.attr('style')) {
5845
+ nub.removeAttr('style');
5846
+ }
5847
+
5211
5848
  tip.removeClass('tip-override');
5212
5849
  if (classes && classes.indexOf('tip-top') > -1) {
5213
- if (Foundation.rtl) nub.addClass('rtl');
5850
+ if (Foundation.rtl) {
5851
+ nub.addClass('rtl');
5852
+ }
5214
5853
  objPos(tip, (target.offset().top - tip.outerHeight()), 'auto', 'auto', left)
5215
5854
  .removeClass('tip-override');
5216
5855
  } else if (classes && classes.indexOf('tip-left') > -1) {
@@ -5245,14 +5884,14 @@
5245
5884
  return $.trim(filtered);
5246
5885
  },
5247
5886
 
5248
- convert_to_touch : function($target) {
5887
+ convert_to_touch : function ($target) {
5249
5888
  var self = this,
5250
5889
  $tip = self.getTip($target),
5251
5890
  settings = $.extend({}, self.settings, self.data_options($target));
5252
5891
 
5253
5892
  if ($tip.find('.tap-to-close').length === 0) {
5254
- $tip.append('<span class="tap-to-close">'+settings.touch_close_text+'</span>');
5255
- $tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function(e) {
5893
+ $tip.append('<span class="tap-to-close">' + settings.touch_close_text + '</span>');
5894
+ $tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function (e) {
5256
5895
  self.hide($target);
5257
5896
  });
5258
5897
  }
@@ -5274,8 +5913,7 @@
5274
5913
 
5275
5914
  hide : function ($target) {
5276
5915
  var $tip = this.getTip($target);
5277
-
5278
- $tip.fadeOut(150, function() {
5916
+ $tip.fadeOut(150, function () {
5279
5917
  $tip.find('.tap-to-close').remove();
5280
5918
  $tip.off('click.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose');
5281
5919
  $target.removeClass('open');
@@ -5300,17 +5938,19 @@
5300
5938
  Foundation.libs.topbar = {
5301
5939
  name : 'topbar',
5302
5940
 
5303
- version: '5.4.7',
5941
+ version : '5.5.2',
5304
5942
 
5305
5943
  settings : {
5306
5944
  index : 0,
5945
+ start_offset : 0,
5307
5946
  sticky_class : 'sticky',
5308
- custom_back_text: true,
5309
- back_text: 'Back',
5310
- mobile_show_parent_link: true,
5311
- is_hover: true,
5947
+ custom_back_text : true,
5948
+ back_text : 'Back',
5949
+ mobile_show_parent_link : true,
5950
+ is_hover : true,
5312
5951
  scrolltop : true, // jump to top when sticky nav menu toggle is clicked
5313
- sticky_on : 'all'
5952
+ sticky_on : 'all',
5953
+ dropdown_autoclose: true
5314
5954
  },
5315
5955
 
5316
5956
  init : function (section, method, options) {
@@ -5356,29 +5996,29 @@
5356
5996
 
5357
5997
  },
5358
5998
 
5359
- is_sticky: function (topbar, topbarContainer, settings) {
5360
- var sticky = topbarContainer.hasClass(settings.sticky_class);
5999
+ is_sticky : function (topbar, topbarContainer, settings) {
6000
+ var sticky = topbarContainer.hasClass(settings.sticky_class);
6001
+ var smallMatch = matchMedia(Foundation.media_queries.small).matches;
6002
+ var medMatch = matchMedia(Foundation.media_queries.medium).matches;
6003
+ var lrgMatch = matchMedia(Foundation.media_queries.large).matches;
5361
6004
 
5362
6005
  if (sticky && settings.sticky_on === 'all') {
5363
6006
  return true;
5364
- } else if (sticky && this.small() && settings.sticky_on === 'small') {
5365
- return (matchMedia(Foundation.media_queries.small).matches && !matchMedia(Foundation.media_queries.medium).matches &&
5366
- !matchMedia(Foundation.media_queries.large).matches);
5367
- //return true;
5368
- } else if (sticky && this.medium() && settings.sticky_on === 'medium') {
5369
- return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
5370
- !matchMedia(Foundation.media_queries.large).matches);
5371
- //return true;
5372
- } else if(sticky && this.large() && settings.sticky_on === 'large') {
5373
- return (matchMedia(Foundation.media_queries.small).matches && matchMedia(Foundation.media_queries.medium).matches &&
5374
- matchMedia(Foundation.media_queries.large).matches);
5375
- //return true;
6007
+ }
6008
+ if (sticky && this.small() && settings.sticky_on.indexOf('small') !== -1) {
6009
+ if (smallMatch && !medMatch && !lrgMatch) { return true; }
6010
+ }
6011
+ if (sticky && this.medium() && settings.sticky_on.indexOf('medium') !== -1) {
6012
+ if (smallMatch && medMatch && !lrgMatch) { return true; }
6013
+ }
6014
+ if (sticky && this.large() && settings.sticky_on.indexOf('large') !== -1) {
6015
+ if (smallMatch && medMatch && lrgMatch) { return true; }
5376
6016
  }
5377
6017
 
5378
- return false;
6018
+ return false;
5379
6019
  },
5380
6020
 
5381
- toggle: function (toggleEl) {
6021
+ toggle : function (toggleEl) {
5382
6022
  var self = this,
5383
6023
  topbar;
5384
6024
 
@@ -5394,11 +6034,11 @@
5394
6034
 
5395
6035
  if (self.breakpoint()) {
5396
6036
  if (!self.rtl) {
5397
- section.css({left: '0%'});
5398
- $('>.name', section).css({left: '100%'});
6037
+ section.css({left : '0%'});
6038
+ $('>.name', section).css({left : '100%'});
5399
6039
  } else {
5400
- section.css({right: '0%'});
5401
- $('>.name', section).css({right: '100%'});
6040
+ section.css({right : '0%'});
6041
+ $('>.name', section).css({right : '100%'});
5402
6042
  }
5403
6043
 
5404
6044
  self.S('li.moved', section).removeClass('moved');
@@ -5422,7 +6062,7 @@
5422
6062
  topbar.addClass('fixed');
5423
6063
  self.S('body').removeClass('f-topbar-fixed');
5424
6064
 
5425
- window.scrollTo(0,0);
6065
+ window.scrollTo(0, 0);
5426
6066
  } else {
5427
6067
  topbar.parent().removeClass('expanded');
5428
6068
  }
@@ -5458,12 +6098,19 @@
5458
6098
  e.preventDefault();
5459
6099
  self.toggle(this);
5460
6100
  })
5461
- .on('click.fndtn.topbar','.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]',function (e) {
5462
- var li = $(this).closest('li');
5463
- if(self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown'))
5464
- {
5465
- self.toggle();
6101
+ .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) {
6102
+ var li = $(this).closest('li'),
6103
+ topbar = li.closest('[' + self.attr_name() + ']'),
6104
+ settings = topbar.data(self.attr_name(true) + '-init');
6105
+
6106
+ if (settings.dropdown_autoclose && settings.is_hover) {
6107
+ var hoverLi = $(this).closest('.hover');
6108
+ hoverLi.removeClass('hover');
5466
6109
  }
6110
+ if (self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) {
6111
+ self.toggle();
6112
+ }
6113
+
5467
6114
  })
5468
6115
  .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
5469
6116
  var li = S(this),
@@ -5471,13 +6118,18 @@
5471
6118
  topbar = li.closest('[' + self.attr_name() + ']'),
5472
6119
  settings = topbar.data(self.attr_name(true) + '-init');
5473
6120
 
5474
- if(target.data('revealId')) {
6121
+ if (target.data('revealId')) {
5475
6122
  self.toggle();
5476
6123
  return;
5477
6124
  }
5478
6125
 
5479
- if (self.breakpoint()) return;
5480
- if (settings.is_hover && !Modernizr.touch) return;
6126
+ if (self.breakpoint()) {
6127
+ return;
6128
+ }
6129
+
6130
+ if (settings.is_hover && !Modernizr.touch) {
6131
+ return;
6132
+ }
5481
6133
 
5482
6134
  e.stopImmediatePropagation();
5483
6135
 
@@ -5514,22 +6166,22 @@
5514
6166
  $selectedLi.addClass('moved');
5515
6167
 
5516
6168
  if (!self.rtl) {
5517
- section.css({left: -(100 * topbar.data('index')) + '%'});
5518
- section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
6169
+ section.css({left : -(100 * topbar.data('index')) + '%'});
6170
+ section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
5519
6171
  } else {
5520
- section.css({right: -(100 * topbar.data('index')) + '%'});
5521
- section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
6172
+ section.css({right : -(100 * topbar.data('index')) + '%'});
6173
+ section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
5522
6174
  }
5523
6175
 
5524
6176
  topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height'));
5525
6177
  }
5526
6178
  });
5527
6179
 
5528
- S(window).off(".topbar").on("resize.fndtn.topbar", self.throttle(function() {
6180
+ S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
5529
6181
  self.resize.call(self);
5530
- }, 50)).trigger("resize").trigger("resize.fndtn.topbar").load(function(){
6182
+ }, 50)).trigger('resize.fndtn.topbar').load(function () {
5531
6183
  // Ensure that the offset is calculated after all of the pages resources have loaded
5532
- S(this).trigger("resize.fndtn.topbar");
6184
+ S(this).trigger('resize.fndtn.topbar');
5533
6185
  });
5534
6186
 
5535
6187
  S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
@@ -5556,11 +6208,11 @@
5556
6208
  topbar.data('index', topbar.data('index') - 1);
5557
6209
 
5558
6210
  if (!self.rtl) {
5559
- section.css({left: -(100 * topbar.data('index')) + '%'});
5560
- section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
6211
+ section.css({left : -(100 * topbar.data('index')) + '%'});
6212
+ section.find('>.name').css({left : 100 * topbar.data('index') + '%'});
5561
6213
  } else {
5562
- section.css({right: -(100 * topbar.data('index')) + '%'});
5563
- section.find('>.name').css({right: 100 * topbar.data('index') + '%'});
6214
+ section.css({right : -(100 * topbar.data('index')) + '%'});
6215
+ section.find('>.name').css({right : 100 * topbar.data('index') + '%'});
5564
6216
  }
5565
6217
 
5566
6218
  if (topbar.data('index') === 0) {
@@ -5576,10 +6228,10 @@
5576
6228
 
5577
6229
  // Show dropdown menus when their items are focused
5578
6230
  S(this.scope).find('.dropdown a')
5579
- .focus(function() {
6231
+ .focus(function () {
5580
6232
  $(this).parents('.has-dropdown').addClass('hover');
5581
6233
  })
5582
- .blur(function() {
6234
+ .blur(function () {
5583
6235
  $(this).parents('.has-dropdown').removeClass('hover');
5584
6236
  });
5585
6237
  },
@@ -5601,18 +6253,18 @@
5601
6253
  .find('li')
5602
6254
  .removeClass('hover');
5603
6255
 
5604
- if(doToggle) {
6256
+ if (doToggle) {
5605
6257
  self.toggle(topbar);
5606
6258
  }
5607
6259
  }
5608
6260
 
5609
- if(self.is_sticky(topbar, stickyContainer, settings)) {
5610
- if(stickyContainer.hasClass('fixed')) {
6261
+ if (self.is_sticky(topbar, stickyContainer, settings)) {
6262
+ if (stickyContainer.hasClass('fixed')) {
5611
6263
  // Remove the fixed to allow for correct calculation of the offset.
5612
6264
  stickyContainer.removeClass('fixed');
5613
6265
 
5614
6266
  stickyOffset = stickyContainer.offset().top;
5615
- if(self.S(document.body).hasClass('f-topbar-fixed')) {
6267
+ if (self.S(document.body).hasClass('f-topbar-fixed')) {
5616
6268
  stickyOffset -= topbar.data('height');
5617
6269
  }
5618
6270
 
@@ -5657,11 +6309,10 @@
5657
6309
  url = $link.attr('href'),
5658
6310
  $titleLi;
5659
6311
 
5660
-
5661
6312
  if (!$dropdown.find('.title.back').length) {
5662
6313
 
5663
6314
  if (settings.mobile_show_parent_link == true && url) {
5664
- $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link show-for-small"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
6315
+ $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>');
5665
6316
  } else {
5666
6317
  $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
5667
6318
  }
@@ -5686,7 +6337,7 @@
5686
6337
  },
5687
6338
 
5688
6339
  assembled : function (topbar) {
5689
- topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled: true}));
6340
+ topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled : true}));
5690
6341
  },
5691
6342
 
5692
6343
  height : function (ul) {
@@ -5703,18 +6354,18 @@
5703
6354
  sticky : function () {
5704
6355
  var self = this;
5705
6356
 
5706
- this.S(window).on('scroll', function() {
6357
+ this.S(window).on('scroll', function () {
5707
6358
  self.update_sticky_positioning();
5708
6359
  });
5709
6360
  },
5710
6361
 
5711
- update_sticky_positioning: function() {
6362
+ update_sticky_positioning : function () {
5712
6363
  var klass = '.' + this.settings.sticky_class,
5713
6364
  $window = this.S(window),
5714
6365
  self = this;
5715
6366
 
5716
6367
  if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) {
5717
- var distance = this.settings.sticky_topbar.data('stickyoffset');
6368
+ var distance = this.settings.sticky_topbar.data('stickyoffset') + this.settings.start_offset;
5718
6369
  if (!self.S(klass).hasClass('expanded')) {
5719
6370
  if ($window.scrollTop() > (distance)) {
5720
6371
  if (!self.S(klass).hasClass('fixed')) {