foundation-rails 6.6.2.0 → 6.9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +2 -0
  4. data/Appraisals +4 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +198 -145
  7. data/bower.json +3 -3
  8. data/foundation-rails.gemspec +4 -4
  9. data/gemfiles/rails_7.1.gemfile +10 -0
  10. data/gemfiles/rails_7.1.gemfile.lock +261 -0
  11. data/lib/foundation/rails/version.rb +1 -1
  12. data/lib/generators/foundation/templates/_settings.scss +32 -28
  13. data/vendor/assets/js/foundation.cjs.js +1996 -3162
  14. data/vendor/assets/js/foundation.cjs.js.map +1 -1
  15. data/vendor/assets/js/foundation.es6.js +385 -292
  16. data/vendor/assets/js/foundation.es6.js.map +1 -1
  17. data/vendor/assets/js/foundation.esm.js +1663 -2832
  18. data/vendor/assets/js/foundation.esm.js.map +1 -1
  19. data/vendor/assets/js/foundation.js +2440 -3870
  20. data/vendor/assets/js/foundation.js.map +1 -1
  21. data/vendor/assets/js/foundation.min.js +1 -1
  22. data/vendor/assets/js/foundation.min.js.map +1 -1
  23. data/vendor/assets/js/plugins/foundation.abide.js +238 -344
  24. data/vendor/assets/js/plugins/foundation.abide.js.map +1 -1
  25. data/vendor/assets/js/plugins/foundation.abide.min.js +1 -1
  26. data/vendor/assets/js/plugins/foundation.abide.min.js.map +1 -1
  27. data/vendor/assets/js/plugins/foundation.accordion.js +197 -275
  28. data/vendor/assets/js/plugins/foundation.accordion.js.map +1 -1
  29. data/vendor/assets/js/plugins/foundation.accordion.min.js +1 -1
  30. data/vendor/assets/js/plugins/foundation.accordion.min.js.map +1 -1
  31. data/vendor/assets/js/plugins/foundation.accordionMenu.js +174 -260
  32. data/vendor/assets/js/plugins/foundation.accordionMenu.js.map +1 -1
  33. data/vendor/assets/js/plugins/foundation.accordionMenu.min.js +1 -1
  34. data/vendor/assets/js/plugins/foundation.accordionMenu.min.js.map +1 -1
  35. data/vendor/assets/js/plugins/foundation.core.js +308 -447
  36. data/vendor/assets/js/plugins/foundation.core.js.map +1 -1
  37. data/vendor/assets/js/plugins/foundation.core.min.js +1 -1
  38. data/vendor/assets/js/plugins/foundation.core.min.js.map +1 -1
  39. data/vendor/assets/js/plugins/foundation.drilldown.js +258 -358
  40. data/vendor/assets/js/plugins/foundation.drilldown.js.map +1 -1
  41. data/vendor/assets/js/plugins/foundation.drilldown.min.js +1 -1
  42. data/vendor/assets/js/plugins/foundation.drilldown.min.js.map +1 -1
  43. data/vendor/assets/js/plugins/foundation.dropdown.js +289 -457
  44. data/vendor/assets/js/plugins/foundation.dropdown.js.map +1 -1
  45. data/vendor/assets/js/plugins/foundation.dropdown.min.js +1 -1
  46. data/vendor/assets/js/plugins/foundation.dropdown.min.js.map +1 -1
  47. data/vendor/assets/js/plugins/foundation.dropdownMenu.js +246 -346
  48. data/vendor/assets/js/plugins/foundation.dropdownMenu.js.map +1 -1
  49. data/vendor/assets/js/plugins/foundation.dropdownMenu.min.js +1 -1
  50. data/vendor/assets/js/plugins/foundation.dropdownMenu.min.js.map +1 -1
  51. data/vendor/assets/js/plugins/foundation.equalizer.js +178 -261
  52. data/vendor/assets/js/plugins/foundation.equalizer.js.map +1 -1
  53. data/vendor/assets/js/plugins/foundation.equalizer.min.js +1 -1
  54. data/vendor/assets/js/plugins/foundation.equalizer.min.js.map +1 -1
  55. data/vendor/assets/js/plugins/foundation.interchange.js +227 -326
  56. data/vendor/assets/js/plugins/foundation.interchange.js.map +1 -1
  57. data/vendor/assets/js/plugins/foundation.interchange.min.js +1 -1
  58. data/vendor/assets/js/plugins/foundation.interchange.min.js.map +1 -1
  59. data/vendor/assets/js/plugins/foundation.magellan.js +225 -336
  60. data/vendor/assets/js/plugins/foundation.magellan.js.map +1 -1
  61. data/vendor/assets/js/plugins/foundation.magellan.min.js +1 -1
  62. data/vendor/assets/js/plugins/foundation.magellan.min.js.map +1 -1
  63. data/vendor/assets/js/plugins/foundation.offcanvas.js +326 -471
  64. data/vendor/assets/js/plugins/foundation.offcanvas.js.map +1 -1
  65. data/vendor/assets/js/plugins/foundation.offcanvas.min.js +1 -1
  66. data/vendor/assets/js/plugins/foundation.offcanvas.min.js.map +1 -1
  67. data/vendor/assets/js/plugins/foundation.orbit.js +244 -347
  68. data/vendor/assets/js/plugins/foundation.orbit.js.map +1 -1
  69. data/vendor/assets/js/plugins/foundation.orbit.min.js +1 -1
  70. data/vendor/assets/js/plugins/foundation.orbit.min.js.map +1 -1
  71. data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.js +203 -278
  72. data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.js.map +1 -1
  73. data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.min.js +1 -1
  74. data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.min.js.map +1 -1
  75. data/vendor/assets/js/plugins/foundation.responsiveMenu.js +205 -255
  76. data/vendor/assets/js/plugins/foundation.responsiveMenu.js.map +1 -1
  77. data/vendor/assets/js/plugins/foundation.responsiveMenu.min.js +1 -1
  78. data/vendor/assets/js/plugins/foundation.responsiveMenu.min.js.map +1 -1
  79. data/vendor/assets/js/plugins/foundation.responsiveToggle.js +170 -226
  80. data/vendor/assets/js/plugins/foundation.responsiveToggle.js.map +1 -1
  81. data/vendor/assets/js/plugins/foundation.responsiveToggle.min.js +1 -1
  82. data/vendor/assets/js/plugins/foundation.responsiveToggle.min.js.map +1 -1
  83. data/vendor/assets/js/plugins/foundation.reveal.js +284 -444
  84. data/vendor/assets/js/plugins/foundation.reveal.js.map +1 -1
  85. data/vendor/assets/js/plugins/foundation.reveal.min.js +1 -1
  86. data/vendor/assets/js/plugins/foundation.reveal.min.js.map +1 -1
  87. data/vendor/assets/js/plugins/foundation.slider.js +322 -483
  88. data/vendor/assets/js/plugins/foundation.slider.js.map +1 -1
  89. data/vendor/assets/js/plugins/foundation.slider.min.js +1 -1
  90. data/vendor/assets/js/plugins/foundation.slider.min.js.map +1 -1
  91. data/vendor/assets/js/plugins/foundation.smoothScroll.js +138 -188
  92. data/vendor/assets/js/plugins/foundation.smoothScroll.js.map +1 -1
  93. data/vendor/assets/js/plugins/foundation.smoothScroll.min.js +1 -1
  94. data/vendor/assets/js/plugins/foundation.smoothScroll.min.js.map +1 -1
  95. data/vendor/assets/js/plugins/foundation.sticky.js +253 -394
  96. data/vendor/assets/js/plugins/foundation.sticky.js.map +1 -1
  97. data/vendor/assets/js/plugins/foundation.sticky.min.js +1 -1
  98. data/vendor/assets/js/plugins/foundation.sticky.min.js.map +1 -1
  99. data/vendor/assets/js/plugins/foundation.tabs.js +228 -317
  100. data/vendor/assets/js/plugins/foundation.tabs.js.map +1 -1
  101. data/vendor/assets/js/plugins/foundation.tabs.min.js +1 -1
  102. data/vendor/assets/js/plugins/foundation.tabs.min.js.map +1 -1
  103. data/vendor/assets/js/plugins/foundation.toggler.js +207 -294
  104. data/vendor/assets/js/plugins/foundation.toggler.js.map +1 -1
  105. data/vendor/assets/js/plugins/foundation.toggler.min.js +1 -1
  106. data/vendor/assets/js/plugins/foundation.toggler.min.js.map +1 -1
  107. data/vendor/assets/js/plugins/foundation.tooltip.js +275 -434
  108. data/vendor/assets/js/plugins/foundation.tooltip.js.map +1 -1
  109. data/vendor/assets/js/plugins/foundation.tooltip.min.js +1 -1
  110. data/vendor/assets/js/plugins/foundation.tooltip.min.js.map +1 -1
  111. data/vendor/assets/js/plugins/foundation.util.box.js +130 -186
  112. data/vendor/assets/js/plugins/foundation.util.box.js.map +1 -1
  113. data/vendor/assets/js/plugins/foundation.util.box.min.js +1 -1
  114. data/vendor/assets/js/plugins/foundation.util.box.min.js.map +1 -1
  115. data/vendor/assets/js/plugins/foundation.util.imageLoader.js +110 -150
  116. data/vendor/assets/js/plugins/foundation.util.imageLoader.js.map +1 -1
  117. data/vendor/assets/js/plugins/foundation.util.imageLoader.min.js +1 -1
  118. data/vendor/assets/js/plugins/foundation.util.imageLoader.min.js.map +1 -1
  119. data/vendor/assets/js/plugins/foundation.util.keyboard.js +157 -172
  120. data/vendor/assets/js/plugins/foundation.util.keyboard.js.map +1 -1
  121. data/vendor/assets/js/plugins/foundation.util.keyboard.min.js +1 -1
  122. data/vendor/assets/js/plugins/foundation.util.keyboard.min.js.map +1 -1
  123. data/vendor/assets/js/plugins/foundation.util.mediaQuery.js +167 -233
  124. data/vendor/assets/js/plugins/foundation.util.mediaQuery.js.map +1 -1
  125. data/vendor/assets/js/plugins/foundation.util.mediaQuery.min.js +1 -1
  126. data/vendor/assets/js/plugins/foundation.util.mediaQuery.min.js.map +1 -1
  127. data/vendor/assets/js/plugins/foundation.util.motion.js +123 -161
  128. data/vendor/assets/js/plugins/foundation.util.motion.js.map +1 -1
  129. data/vendor/assets/js/plugins/foundation.util.motion.min.js +1 -1
  130. data/vendor/assets/js/plugins/foundation.util.motion.min.js.map +1 -1
  131. data/vendor/assets/js/plugins/foundation.util.nest.js +123 -160
  132. data/vendor/assets/js/plugins/foundation.util.nest.js.map +1 -1
  133. data/vendor/assets/js/plugins/foundation.util.nest.min.js +1 -1
  134. data/vendor/assets/js/plugins/foundation.util.nest.min.js.map +1 -1
  135. data/vendor/assets/js/plugins/foundation.util.timer.js +116 -171
  136. data/vendor/assets/js/plugins/foundation.util.timer.js.map +1 -1
  137. data/vendor/assets/js/plugins/foundation.util.timer.min.js +1 -1
  138. data/vendor/assets/js/plugins/foundation.util.timer.min.js.map +1 -1
  139. data/vendor/assets/js/plugins/foundation.util.touch.js +172 -228
  140. data/vendor/assets/js/plugins/foundation.util.touch.js.map +1 -1
  141. data/vendor/assets/js/plugins/foundation.util.touch.min.js +1 -1
  142. data/vendor/assets/js/plugins/foundation.util.touch.min.js.map +1 -1
  143. data/vendor/assets/js/plugins/foundation.util.triggers.js +158 -222
  144. data/vendor/assets/js/plugins/foundation.util.triggers.js.map +1 -1
  145. data/vendor/assets/js/plugins/foundation.util.triggers.min.js +1 -1
  146. data/vendor/assets/js/plugins/foundation.util.triggers.min.js.map +1 -1
  147. data/vendor/assets/scss/_global.scss +18 -5
  148. data/vendor/assets/scss/components/_accordion-menu.scss +2 -2
  149. data/vendor/assets/scss/components/_badge.scss +1 -1
  150. data/vendor/assets/scss/components/_breadcrumbs.scss +2 -1
  151. data/vendor/assets/scss/components/_button-group.scss +13 -8
  152. data/vendor/assets/scss/components/_button.scss +13 -13
  153. data/vendor/assets/scss/components/_callout.scss +2 -2
  154. data/vendor/assets/scss/components/_close-button.scss +5 -4
  155. data/vendor/assets/scss/components/_dropdown-menu.scss +1 -1
  156. data/vendor/assets/scss/components/_label.scss +1 -1
  157. data/vendor/assets/scss/components/_menu.scss +54 -19
  158. data/vendor/assets/scss/components/_off-canvas.scss +18 -16
  159. data/vendor/assets/scss/components/_orbit.scss +3 -3
  160. data/vendor/assets/scss/components/_pagination.scss +1 -1
  161. data/vendor/assets/scss/components/_progress-bar.scss +1 -1
  162. data/vendor/assets/scss/components/_responsive-embed.scss +1 -1
  163. data/vendor/assets/scss/components/_reveal.scss +8 -3
  164. data/vendor/assets/scss/components/_slider.scss +5 -2
  165. data/vendor/assets/scss/components/_switch.scss +25 -2
  166. data/vendor/assets/scss/components/_table.scss +8 -7
  167. data/vendor/assets/scss/components/_tabs.scss +2 -2
  168. data/vendor/assets/scss/components/_top-bar.scss +7 -5
  169. data/vendor/assets/scss/components/_visibility.scss +45 -2
  170. data/vendor/assets/scss/forms/_label.scss +2 -1
  171. data/vendor/assets/scss/forms/_progress.scss +1 -1
  172. data/vendor/assets/scss/forms/_range.scss +1 -1
  173. data/vendor/assets/scss/forms/_select.scss +5 -4
  174. data/vendor/assets/scss/forms/_text.scss +2 -2
  175. data/vendor/assets/scss/foundation.scss +1 -1
  176. data/vendor/assets/scss/grid/_classes.scss +1 -1
  177. data/vendor/assets/scss/grid/_column.scss +3 -2
  178. data/vendor/assets/scss/grid/_flex-grid.scss +7 -6
  179. data/vendor/assets/scss/grid/_gutter.scss +1 -1
  180. data/vendor/assets/scss/grid/_layout.scss +5 -5
  181. data/vendor/assets/scss/grid/_position.scss +4 -4
  182. data/vendor/assets/scss/grid/_row.scss +1 -1
  183. data/vendor/assets/scss/motion-ui/util/_animation.scss +1 -1
  184. data/vendor/assets/scss/motion-ui/util/_series.scss +1 -1
  185. data/vendor/assets/scss/motion-ui/util/_unit.scss +54 -1
  186. data/vendor/assets/scss/prototype/_border-none.scss +1 -1
  187. data/vendor/assets/scss/prototype/_font-styling.scss +2 -2
  188. data/vendor/assets/scss/prototype/_overflow.scss +9 -0
  189. data/vendor/assets/scss/prototype/_rotate.scss +7 -5
  190. data/vendor/assets/scss/prototype/_separator.scss +5 -5
  191. data/vendor/assets/scss/prototype/_shadow.scss +1 -2
  192. data/vendor/assets/scss/prototype/_spacing.scss +33 -33
  193. data/vendor/assets/scss/prototype/_text-transformation.scss +3 -3
  194. data/vendor/assets/scss/settings/_settings.scss +32 -28
  195. data/vendor/assets/scss/typography/_base.scss +6 -6
  196. data/vendor/assets/scss/typography/_helpers.scss +10 -2
  197. data/vendor/assets/scss/typography/_print.scss +2 -2
  198. data/vendor/assets/scss/util/_breakpoint.scss +21 -18
  199. data/vendor/assets/scss/util/_color.scss +20 -8
  200. data/vendor/assets/scss/util/_direction.scss +1 -1
  201. data/vendor/assets/scss/util/_flex.scss +1 -1
  202. data/vendor/assets/scss/util/_math.scss +61 -9
  203. data/vendor/assets/scss/util/_mixins.scss +18 -14
  204. data/vendor/assets/scss/util/_selector.scss +1 -15
  205. data/vendor/assets/scss/util/_typography.scss +6 -6
  206. data/vendor/assets/scss/util/_unit.scss +14 -8
  207. data/vendor/assets/scss/util/_value.scss +3 -18
  208. data/vendor/assets/scss/vendor/normalize.scss +19 -2
  209. data/vendor/assets/scss/xy-grid/_cell.scss +16 -5
  210. data/vendor/assets/scss/xy-grid/_classes.scss +8 -8
  211. data/vendor/assets/scss/xy-grid/_frame.scss +12 -0
  212. data/vendor/assets/scss/xy-grid/_grid.scss +2 -2
  213. data/vendor/assets/scss/xy-grid/_gutters.scss +2 -2
  214. data/vendor/assets/scss/xy-grid/_layout.scss +1 -1
  215. data/vendor/assets/scss/xy-grid/_position.scss +12 -7
  216. data/vendor/assets/scss/xy-grid/_xy-grid.scss +2 -2
  217. metadata +21 -19
@@ -144,6 +144,7 @@ function ignoreMousedisappear(handler, { ignoreLeaveWindow = false, ignoreReappe
144
144
  }
145
145
 
146
146
  var foundation_core_utils = /*#__PURE__*/Object.freeze({
147
+ __proto__: null,
147
148
  rtl: rtl,
148
149
  GetYoDigits: GetYoDigits,
149
150
  RegExpEscape: RegExpEscape,
@@ -152,6 +153,20 @@ var foundation_core_utils = /*#__PURE__*/Object.freeze({
152
153
  ignoreMousedisappear: ignoreMousedisappear
153
154
  });
154
155
 
156
+ // Default set of media queries
157
+ // const defaultQueries = {
158
+ // 'default' : 'only screen',
159
+ // landscape : 'only screen and (orientation: landscape)',
160
+ // portrait : 'only screen and (orientation: portrait)',
161
+ // retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
162
+ // 'only screen and (min--moz-device-pixel-ratio: 2),' +
163
+ // 'only screen and (-o-min-device-pixel-ratio: 2/1),' +
164
+ // 'only screen and (min-device-pixel-ratio: 2),' +
165
+ // 'only screen and (min-resolution: 192dpi),' +
166
+ // 'only screen and (min-resolution: 2dppx)'
167
+ // };
168
+
169
+
155
170
  // matchMedia() polyfill - Test a CSS media type/query in JS.
156
171
  // Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license
157
172
  /* eslint-disable */
@@ -218,7 +233,7 @@ var MediaQuery = {
218
233
 
219
234
  // make sure the initialization is only done once when calling _init() several times
220
235
  if (this.isInitialized === true) {
221
- return;
236
+ return this;
222
237
  } else {
223
238
  this.isInitialized = true;
224
239
  }
@@ -226,7 +241,7 @@ var MediaQuery = {
226
241
  var self = this;
227
242
  var $meta = $('meta.foundation-mq');
228
243
  if(!$meta.length){
229
- $('<meta class="foundation-mq">').appendTo(document.head);
244
+ $('<meta class="foundation-mq" name="foundation-mq" content>').appendTo(document.head);
230
245
  }
231
246
 
232
247
  var extractedStyles = $('.foundation-mq').css('font-family');
@@ -417,7 +432,7 @@ var MediaQuery = {
417
432
  * @private
418
433
  */
419
434
  _watcher() {
420
- $(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', () => {
435
+ $(window).on('resize.zf.trigger', () => {
421
436
  var newSize = this._getCurrentSize(), currentSize = this.current;
422
437
 
423
438
  if (newSize !== currentSize) {
@@ -470,7 +485,7 @@ function parseStyleToObject(str) {
470
485
  return styleObject;
471
486
  }
472
487
 
473
- var FOUNDATION_VERSION = '6.6.2';
488
+ var FOUNDATION_VERSION = '6.9.0';
474
489
 
475
490
  // Global Foundation object
476
491
  // This is attached to the window, or used as a module for AMD/Browserify
@@ -497,7 +512,7 @@ var Foundation = {
497
512
  var className = (name || functionName(plugin));
498
513
  // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin
499
514
  // Examples: data-reveal, data-off-canvas
500
- var attrName = hyphenate(className);
515
+ var attrName = hyphenate$1(className);
501
516
 
502
517
  // Add to the Foundation object and the plugins list (for reflowing)
503
518
  this._plugins[attrName] = this[className] = plugin;
@@ -512,7 +527,7 @@ var Foundation = {
512
527
  * @fires Plugin#init
513
528
  */
514
529
  registerPlugin: function(plugin, name){
515
- var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();
530
+ var pluginName = name ? hyphenate$1(name) : functionName(plugin.constructor).toLowerCase();
516
531
  plugin.uuid = GetYoDigits(6, pluginName);
517
532
 
518
533
  if(!plugin.$element.attr(`data-${pluginName}`)){ plugin.$element.attr(`data-${pluginName}`, plugin.uuid); }
@@ -536,7 +551,7 @@ var Foundation = {
536
551
  * @fires Plugin#destroyed
537
552
  */
538
553
  unregisterPlugin: function(plugin){
539
- var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));
554
+ var pluginName = hyphenate$1(functionName(plugin.$element.data('zfPlugin').constructor));
540
555
 
541
556
  this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);
542
557
  plugin.$element.removeAttr(`data-${pluginName}`).removeData('zfPlugin')
@@ -546,7 +561,9 @@ var Foundation = {
546
561
  */
547
562
  .trigger(`destroyed.zf.${pluginName}`);
548
563
  for(var prop in plugin){
549
- plugin[prop] = null;//clean up script to prep for garbage collection.
564
+ if(typeof plugin[prop] === 'function'){
565
+ plugin[prop] = null; //clean up script to prep for garbage collection.
566
+ }
550
567
  }
551
568
  return;
552
569
  },
@@ -564,22 +581,22 @@ var Foundation = {
564
581
  plugins.each(function(){
565
582
  $(this).data('zfPlugin')._init();
566
583
  });
567
- }else{
584
+ }else {
568
585
  var type = typeof plugins,
569
586
  _this = this,
570
587
  fns = {
571
588
  'object': function(plgs){
572
589
  plgs.forEach(function(p){
573
- p = hyphenate(p);
590
+ p = hyphenate$1(p);
574
591
  $('[data-'+ p +']').foundation('_init');
575
592
  });
576
593
  },
577
594
  'string': function(){
578
- plugins = hyphenate(plugins);
595
+ plugins = hyphenate$1(plugins);
579
596
  $('[data-'+ plugins +']').foundation('_init');
580
597
  },
581
598
  'undefined': function(){
582
- this['object'](Object.keys(_this._plugins));
599
+ this.object(Object.keys(_this._plugins));
583
600
  }
584
601
  };
585
602
  fns[type](plugins);
@@ -625,7 +642,7 @@ var Foundation = {
625
642
  opts = { reflow: true };
626
643
 
627
644
  if($el.attr('data-options')){
628
- $el.attr('data-options').split(';').forEach(function(option, _index){
645
+ $el.attr('data-options').split(';').forEach(function(option){
629
646
  var opt = option.split(':').map(function(el){ return el.trim(); });
630
647
  if(opt[0]) opts[opt[0]] = parseValue(opt[1]);
631
648
  });
@@ -642,7 +659,7 @@ var Foundation = {
642
659
  },
643
660
  getFnName: functionName,
644
661
 
645
- addToJquery: function($) {
662
+ addToJquery: function() {
646
663
  // TODO: consider not making this a jQuery function
647
664
  // TODO: need way to reflow vs. re-initialize
648
665
  /**
@@ -667,15 +684,15 @@ var Foundation = {
667
684
  if(typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined'){//make sure both the class and method exist
668
685
  if(this.length === 1){//if there's only one, call it directly.
669
686
  plugClass[method].apply(plugClass, args);
670
- }else{
687
+ }else {
671
688
  this.each(function(i, el){//otherwise loop through the jQuery collection and invoke the method on each
672
689
  plugClass[method].apply($(el).data('zfPlugin'), args);
673
690
  });
674
691
  }
675
- }else{//error for no class or no method
692
+ }else {//error for no class or no method
676
693
  throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.');
677
694
  }
678
- }else{//error for invalid argument type
695
+ }else {//error for invalid argument type
679
696
  throw new TypeError(`We're sorry, ${type} is not a valid parameter. You must use a string representing the method you wish to invoke.`);
680
697
  }
681
698
  return this;
@@ -745,6 +762,7 @@ window.Foundation = Foundation;
745
762
  }
746
763
  })();
747
764
  if (!Function.prototype.bind) {
765
+ /* eslint-disable no-extend-native */
748
766
  Function.prototype.bind = function(oThis) {
749
767
  if (typeof this !== 'function') {
750
768
  // closest thing possible to the ECMAScript 5
@@ -793,7 +811,7 @@ function parseValue(str){
793
811
  }
794
812
  // Convert PascalCase to kebab-case
795
813
  // Thank you: http://stackoverflow.com/a/8955580
796
- function hyphenate(str) {
814
+ function hyphenate$1(str) {
797
815
  return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
798
816
  }
799
817
 
@@ -993,7 +1011,7 @@ function onImagesLoaded(images, callback){
993
1011
  var image = new Image();
994
1012
  // Still count image as loaded if it finalizes with an error.
995
1013
  var events = "load.zf.images error.zf.images";
996
- $(image).one(events, function me(event){
1014
+ $(image).one(events, function me(){
997
1015
  // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.
998
1016
  $(this).off(events, me);
999
1017
  singleImageLoaded();
@@ -1039,6 +1057,32 @@ function findFocusable($element) {
1039
1057
  return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function() {
1040
1058
  if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) { return false; } //only have visible elements and those that have a tabindex greater or equal 0
1041
1059
  return true;
1060
+ })
1061
+ .sort( function( a, b ) {
1062
+ if ($(a).attr('tabindex') === $(b).attr('tabindex')) {
1063
+ return 0;
1064
+ }
1065
+ let aTabIndex = parseInt($(a).attr('tabindex'), 10),
1066
+ bTabIndex = parseInt($(b).attr('tabindex'), 10);
1067
+ // Undefined is treated the same as 0
1068
+ if (typeof $(a).attr('tabindex') === 'undefined' && bTabIndex > 0) {
1069
+ return 1;
1070
+ }
1071
+ if (typeof $(b).attr('tabindex') === 'undefined' && aTabIndex > 0) {
1072
+ return -1;
1073
+ }
1074
+ if (aTabIndex === 0 && bTabIndex > 0) {
1075
+ return 1;
1076
+ }
1077
+ if (bTabIndex === 0 && aTabIndex > 0) {
1078
+ return -1;
1079
+ }
1080
+ if (aTabIndex < bTabIndex) {
1081
+ return -1;
1082
+ }
1083
+ if (aTabIndex > bTabIndex) {
1084
+ return 1;
1085
+ }
1042
1086
  });
1043
1087
  }
1044
1088
 
@@ -1173,7 +1217,9 @@ var Keyboard = {
1173
1217
  */
1174
1218
  function getKeyCodes(kcs) {
1175
1219
  var k = {};
1176
- for (var kc in kcs) k[kcs[kc]] = kcs[kc];
1220
+ for (var kc in kcs) {
1221
+ if (kcs.hasOwnProperty(kc)) k[kcs[kc]] = kcs[kc];
1222
+ }
1177
1223
  return k;
1178
1224
  }
1179
1225
 
@@ -1197,7 +1243,6 @@ const Motion = {
1197
1243
 
1198
1244
  function Move(duration, elem, fn){
1199
1245
  var anim, prog, start = null;
1200
- // console.log('called');
1201
1246
 
1202
1247
  if (duration === 0) {
1203
1248
  fn.apply(elem);
@@ -1207,12 +1252,11 @@ function Move(duration, elem, fn){
1207
1252
 
1208
1253
  function move(ts){
1209
1254
  if(!start) start = ts;
1210
- // console.log(start, ts);
1211
1255
  prog = ts - start;
1212
1256
  fn.apply(elem);
1213
1257
 
1214
1258
  if(prog < duration){ anim = window.requestAnimationFrame(move, elem); }
1215
- else{
1259
+ else {
1216
1260
  window.cancelAnimationFrame(anim);
1217
1261
  elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
1218
1262
  }
@@ -1295,9 +1339,10 @@ const Nest = {
1295
1339
  if ($sub.length) {
1296
1340
  $item.addClass(hasSubClass);
1297
1341
  if(applyAria) {
1298
- $item.attr({
1342
+ const firstItem = $item.children('a:first');
1343
+ firstItem.attr({
1299
1344
  'aria-haspopup': true,
1300
- 'aria-label': $item.children('a:first').text()
1345
+ 'aria-label': firstItem.attr('aria-label') || firstItem.text()
1301
1346
  });
1302
1347
  // Note: Drilldowns behave differently in how they hide, and so need
1303
1348
  // additional attributes. We should look if this possibly over-generalized
@@ -1387,7 +1432,6 @@ function Timer(elem, options, cb) {
1387
1432
  var Touch = {};
1388
1433
 
1389
1434
  var startPosX,
1390
- startPosY,
1391
1435
  startTime,
1392
1436
  elapsedTime,
1393
1437
  startEvent,
@@ -1410,12 +1454,13 @@ function onTouchEnd(e) {
1410
1454
  }
1411
1455
 
1412
1456
  function onTouchMove(e) {
1413
- if ($.spotSwipe.preventDefault) { e.preventDefault(); }
1457
+ if (true === $.spotSwipe.preventDefault) { e.preventDefault(); }
1414
1458
 
1415
1459
  if(isMoving) {
1416
1460
  var x = e.touches[0].pageX;
1417
- var y = e.touches[0].pageY;
1461
+ // var y = e.touches[0].pageY;
1418
1462
  var dx = startPosX - x;
1463
+ // var dy = startPosY - y;
1419
1464
  var dir;
1420
1465
  didMoved = true;
1421
1466
  elapsedTime = new Date().getTime() - startTime;
@@ -1438,35 +1483,36 @@ function onTouchMove(e) {
1438
1483
 
1439
1484
  function onTouchStart(e) {
1440
1485
 
1441
- if (e.touches.length == 1) {
1486
+ if (e.touches.length === 1) {
1442
1487
  startPosX = e.touches[0].pageX;
1443
- startPosY = e.touches[0].pageY;
1444
1488
  startEvent = e;
1445
1489
  isMoving = true;
1446
1490
  didMoved = false;
1447
1491
  startTime = new Date().getTime();
1448
- this.addEventListener('touchmove', onTouchMove, false);
1492
+ this.addEventListener('touchmove', onTouchMove, { passive : true === $.spotSwipe.preventDefault });
1449
1493
  this.addEventListener('touchend', onTouchEnd, false);
1450
1494
  }
1451
1495
  }
1452
1496
 
1453
1497
  function init() {
1454
- this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
1498
+ this.addEventListener && this.addEventListener('touchstart', onTouchStart, { passive : true });
1455
1499
  }
1456
1500
 
1501
+ // function teardown() {
1502
+ // this.removeEventListener('touchstart', onTouchStart);
1503
+ // }
1504
+
1457
1505
  class SpotSwipe {
1458
- constructor($) {
1506
+ constructor() {
1459
1507
  this.version = '1.0.0';
1460
1508
  this.enabled = 'ontouchstart' in document.documentElement;
1461
1509
  this.preventDefault = false;
1462
1510
  this.moveThreshold = 75;
1463
1511
  this.timeThreshold = 200;
1464
- this.$ = $;
1465
1512
  this._init();
1466
1513
  }
1467
1514
 
1468
1515
  _init() {
1469
- var $ = this.$;
1470
1516
  $.event.special.swipe = { setup: init };
1471
1517
  $.event.special.tap = { setup: init };
1472
1518
 
@@ -1485,16 +1531,16 @@ class SpotSwipe {
1485
1531
  * values, and do not add event handlers directly. *
1486
1532
  ****************************************************/
1487
1533
 
1488
- Touch.setupSpotSwipe = function($) {
1534
+ Touch.setupSpotSwipe = function() {
1489
1535
  $.spotSwipe = new SpotSwipe($);
1490
1536
  };
1491
1537
 
1492
1538
  /****************************************************
1493
1539
  * Method for adding pseudo drag events to elements *
1494
1540
  ***************************************************/
1495
- Touch.setupTouchHandler = function($) {
1541
+ Touch.setupTouchHandler = function() {
1496
1542
  $.fn.addTouch = function(){
1497
- this.each(function(i,el){
1543
+ this.each(function(i, el){
1498
1544
  $(el).bind('touchstart touchmove touchend touchcancel', function(event) {
1499
1545
  //we pass the original event object because the jQuery event
1500
1546
  //object is normalized to w3c specs and does not provide the TouchList
@@ -1502,7 +1548,7 @@ Touch.setupTouchHandler = function($) {
1502
1548
  });
1503
1549
  });
1504
1550
 
1505
- var handleTouch = function(event){
1551
+ var handleTouch = function(event) {
1506
1552
  var touches = event.changedTouches,
1507
1553
  first = touches[0],
1508
1554
  eventTypes = {
@@ -1532,8 +1578,7 @@ Touch.setupTouchHandler = function($) {
1532
1578
  };
1533
1579
  };
1534
1580
 
1535
- Touch.init = function ($) {
1536
-
1581
+ Touch.init = function () {
1537
1582
  if(typeof($.spotSwipe) === 'undefined') {
1538
1583
  Touch.setupSpotSwipe($);
1539
1584
  Touch.setupTouchHandler($);
@@ -1548,7 +1593,7 @@ const MutationObserver = (function () {
1548
1593
  }
1549
1594
  }
1550
1595
  return false;
1551
- }());
1596
+ })();
1552
1597
 
1553
1598
  const triggers = (el, type) => {
1554
1599
  el.data(type).split(' ').forEach(id => {
@@ -1595,7 +1640,7 @@ Triggers.Listeners.Basic = {
1595
1640
  Motion.animateOut($(this), animation, function() {
1596
1641
  $(this).trigger('closed.zf');
1597
1642
  });
1598
- }else{
1643
+ }else {
1599
1644
  $(this).fadeOut().trigger('closed.zf');
1600
1645
  }
1601
1646
  },
@@ -1679,7 +1724,7 @@ Triggers.Initializers.addClosemeListener = function(pluginName) {
1679
1724
  plugNames.push(pluginName);
1680
1725
  }else if(typeof pluginName === 'object' && typeof pluginName[0] === 'string'){
1681
1726
  plugNames = plugNames.concat(pluginName);
1682
- }else{
1727
+ }else {
1683
1728
  console.error('Plugin names must be strings');
1684
1729
  }
1685
1730
  }
@@ -1694,11 +1739,11 @@ Triggers.Initializers.addClosemeListener = function(pluginName) {
1694
1739
 
1695
1740
  function debounceGlobalListener(debounce, trigger, listener) {
1696
1741
  let timer, args = Array.prototype.slice.call(arguments, 3);
1697
- $(window).off(trigger).on(trigger, function(e) {
1742
+ $(window).on(trigger, function() {
1698
1743
  if (timer) { clearTimeout(timer); }
1699
1744
  timer = setTimeout(function(){
1700
1745
  listener.apply(null, args);
1701
- }, debounce || 10);//default time to emit scroll event
1746
+ }, debounce || 10); //default time to emit scroll event
1702
1747
  });
1703
1748
  }
1704
1749
 
@@ -1773,13 +1818,13 @@ Triggers.Initializers.addSimpleListeners = function() {
1773
1818
  Triggers.Initializers.addGlobalListeners = function() {
1774
1819
  let $document = $(document);
1775
1820
  Triggers.Initializers.addMutationEventsListener($document);
1776
- Triggers.Initializers.addResizeListener();
1821
+ Triggers.Initializers.addResizeListener(250);
1777
1822
  Triggers.Initializers.addScrollListener();
1778
1823
  Triggers.Initializers.addClosemeListener();
1779
1824
  };
1780
1825
 
1781
1826
 
1782
- Triggers.init = function ($, Foundation) {
1827
+ Triggers.init = function (__, Foundation) {
1783
1828
  onLoad($(window), function () {
1784
1829
  if ($.triggersInitialized !== true) {
1785
1830
  Triggers.Initializers.addSimpleListeners();
@@ -1824,19 +1869,21 @@ class Plugin {
1824
1869
  */
1825
1870
  .trigger(`destroyed.zf.${pluginName}`);
1826
1871
  for(var prop in this){
1827
- this[prop] = null;//clean up script to prep for garbage collection.
1872
+ if (this.hasOwnProperty(prop)) {
1873
+ this[prop] = null; //clean up script to prep for garbage collection.
1874
+ }
1828
1875
  }
1829
1876
  }
1830
1877
  }
1831
1878
 
1832
1879
  // Convert PascalCase to kebab-case
1833
1880
  // Thank you: http://stackoverflow.com/a/8955580
1834
- function hyphenate$1(str) {
1881
+ function hyphenate(str) {
1835
1882
  return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
1836
1883
  }
1837
1884
 
1838
1885
  function getPluginName(obj) {
1839
- return hyphenate$1(obj.className);
1886
+ return hyphenate(obj.className);
1840
1887
  }
1841
1888
 
1842
1889
  /**
@@ -2119,6 +2166,10 @@ class Abide extends Plugin {
2119
2166
  'data-invalid': '',
2120
2167
  'aria-invalid': true
2121
2168
  });
2169
+
2170
+ if ($formError.filter(':visible').length) {
2171
+ this.addA11yErrorDescribe($el, $formError);
2172
+ }
2122
2173
  }
2123
2174
 
2124
2175
  /**
@@ -2129,19 +2180,11 @@ class Abide extends Plugin {
2129
2180
  addA11yAttributes($el) {
2130
2181
  let $errors = this.findFormError($el);
2131
2182
  let $labels = $errors.filter('label');
2132
- let $error = $errors.first();
2133
2183
  if (!$errors.length) return;
2134
2184
 
2135
- // Set [aria-describedby] on the input toward the first form error if it is not set
2136
- if (typeof $el.attr('aria-describedby') === 'undefined') {
2137
- // Get the first error ID or create one
2138
- let errorId = $error.attr('id');
2139
- if (typeof errorId === 'undefined') {
2140
- errorId = GetYoDigits(6, 'abide-error');
2141
- $error.attr('id', errorId);
2142
- }
2143
-
2144
- $el.attr('aria-describedby', errorId);
2185
+ let $error = $errors.filter(':visible').first();
2186
+ if ($error.length) {
2187
+ this.addA11yErrorDescribe($el, $error);
2145
2188
  }
2146
2189
 
2147
2190
  if ($labels.filter('[for]').length < $labels.length) {
@@ -2168,6 +2211,21 @@ class Abide extends Plugin {
2168
2211
  }).end();
2169
2212
  }
2170
2213
 
2214
+ addA11yErrorDescribe($el, $error) {
2215
+ if ($el.attr('type') === 'hidden') return;
2216
+ if (typeof $el.attr('aria-describedby') !== 'undefined') return;
2217
+
2218
+ // Set [aria-describedby] on the input toward the first form error if it is not set
2219
+ // Get the first error ID or create one
2220
+ let errorId = $error.attr('id');
2221
+ if (typeof errorId === 'undefined') {
2222
+ errorId = GetYoDigits(6, 'abide-error');
2223
+ $error.attr('id', errorId);
2224
+ }
2225
+
2226
+ $el.attr('aria-describedby', errorId).data('abide-describedby', true);
2227
+ }
2228
+
2171
2229
  /**
2172
2230
  * Adds [aria-live] attribute to the given global form error $el.
2173
2231
  * @param {Object} $el - jQuery object to add the attribute to
@@ -2233,11 +2291,11 @@ class Abide extends Plugin {
2233
2291
  */
2234
2292
  removeErrorClasses($el) {
2235
2293
  // radios need to clear all of the els
2236
- if ($el[0].type == 'radio') {
2294
+ if ($el[0].type === 'radio') {
2237
2295
  return this.removeRadioErrorClasses($el.attr('name'));
2238
2296
  }
2239
2297
  // checkboxes need to clear all of the els
2240
- else if ($el[0].type == 'checkbox') {
2298
+ else if ($el[0].type === 'checkbox') {
2241
2299
  return this.removeCheckboxErrorClasses($el.attr('name'));
2242
2300
  }
2243
2301
 
@@ -2256,6 +2314,10 @@ class Abide extends Plugin {
2256
2314
  'data-invalid': null,
2257
2315
  'aria-invalid': null
2258
2316
  });
2317
+
2318
+ if ($el.data('abide-describedby')) {
2319
+ $el.removeAttr('aria-describedby').removeData('abide-describedby');
2320
+ }
2259
2321
  }
2260
2322
 
2261
2323
  /**
@@ -2334,9 +2396,8 @@ class Abide extends Plugin {
2334
2396
 
2335
2397
  if (manageErrorClasses) {
2336
2398
  this.removeErrorClasses($el);
2337
-
2338
2399
  if (!goodToGo) {
2339
- this.addErrorClasses($el, failedValidators);
2400
+ this.addErrorClasses($el, failedValidators);
2340
2401
  }
2341
2402
  }
2342
2403
 
@@ -2489,7 +2550,7 @@ class Abide extends Plugin {
2489
2550
  checked++;
2490
2551
  }
2491
2552
  if (typeof $(e).attr('data-min-required') !== 'undefined') {
2492
- minRequired = parseInt($(e).attr('data-min-required'));
2553
+ minRequired = parseInt($(e).attr('data-min-required'), 10);
2493
2554
  }
2494
2555
  });
2495
2556
 
@@ -2669,6 +2730,7 @@ Abide.defaults = {
2669
2730
 
2670
2731
  patterns: {
2671
2732
  alpha : /^[a-zA-Z]+$/,
2733
+ // eslint-disable-next-line camelcase
2672
2734
  alpha_numeric : /^[a-zA-Z0-9]+$/,
2673
2735
  integer : /^[-+]?\d+$/,
2674
2736
  number : /^[-+]?\d*(?:[\.\,]\d+)?$/,
@@ -2695,8 +2757,10 @@ Abide.defaults = {
2695
2757
  time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
2696
2758
  dateISO : /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
2697
2759
  // MM/DD/YYYY
2760
+ // eslint-disable-next-line camelcase
2698
2761
  month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
2699
2762
  // DD/MM/YYYY
2763
+ // eslint-disable-next-line camelcase
2700
2764
  day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
2701
2765
 
2702
2766
  // #FFF or #FFFFFF
@@ -2705,7 +2769,7 @@ Abide.defaults = {
2705
2769
  // Domain || URL
2706
2770
  website: {
2707
2771
  test: (text) => {
2708
- return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);
2772
+ return Abide.defaults.patterns.domain.test(text) || Abide.defaults.patterns.url.test(text);
2709
2773
  }
2710
2774
  }
2711
2775
  },
@@ -2714,12 +2778,10 @@ Abide.defaults = {
2714
2778
  * Optional validation functions to be used. `equalTo` being the only default included function.
2715
2779
  * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:
2716
2780
  * el : The jQuery element to validate.
2717
- * required : Boolean value of the required attribute be present or not.
2718
- * parent : The direct parent of the input.
2719
2781
  * @option
2720
2782
  */
2721
2783
  validators: {
2722
- equalTo: function (el, required, parent) {
2784
+ equalTo: function (el) {
2723
2785
  return $(`#${el.attr('data-equalto')}`).val() === el.val();
2724
2786
  }
2725
2787
  }
@@ -2751,7 +2813,9 @@ class Accordion extends Plugin {
2751
2813
  'ENTER': 'toggle',
2752
2814
  'SPACE': 'toggle',
2753
2815
  'ARROW_DOWN': 'next',
2754
- 'ARROW_UP': 'previous'
2816
+ 'ARROW_UP': 'previous',
2817
+ 'HOME': 'first',
2818
+ 'END': 'last',
2755
2819
  });
2756
2820
  }
2757
2821
 
@@ -2762,10 +2826,8 @@ class Accordion extends Plugin {
2762
2826
  _init() {
2763
2827
  this._isInitializing = true;
2764
2828
 
2765
- this.$element.attr('role', 'tablist');
2766
2829
  this.$tabs = this.$element.children('[data-accordion-item]');
2767
2830
 
2768
- this.$tabs.attr({'role': 'presentation'});
2769
2831
 
2770
2832
  this.$tabs.each(function(idx, el) {
2771
2833
  var $el = $(el),
@@ -2775,13 +2837,11 @@ class Accordion extends Plugin {
2775
2837
 
2776
2838
  $el.find('a:first').attr({
2777
2839
  'aria-controls': id,
2778
- 'role': 'tab',
2779
2840
  'id': linkId,
2780
- 'aria-expanded': false,
2781
- 'aria-selected': false
2841
+ 'aria-expanded': false
2782
2842
  });
2783
2843
 
2784
- $content.attr({'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});
2844
+ $content.attr({'role': 'region', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});
2785
2845
  });
2786
2846
 
2787
2847
  var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
@@ -2876,6 +2936,18 @@ class Accordion extends Plugin {
2876
2936
  $a.trigger('click.zf.accordion');
2877
2937
  }
2878
2938
  },
2939
+ first: function() {
2940
+ var $a = _this.$tabs.first().find('.accordion-title').focus();
2941
+ if (!_this.options.multiExpand) {
2942
+ $a.trigger('click.zf.accordion');
2943
+ }
2944
+ },
2945
+ last: function() {
2946
+ var $a = _this.$tabs.last().find('.accordion-title').focus();
2947
+ if (!_this.options.multiExpand) {
2948
+ $a.trigger('click.zf.accordion');
2949
+ }
2950
+ },
2879
2951
  handled: function() {
2880
2952
  e.preventDefault();
2881
2953
  }
@@ -2990,11 +3062,10 @@ class Accordion extends Plugin {
2990
3062
  $targetItem.addClass('is-active');
2991
3063
 
2992
3064
  $(`#${targetContentId}`).attr({
2993
- 'aria-expanded': true,
2994
- 'aria-selected': true
3065
+ 'aria-expanded': true
2995
3066
  });
2996
3067
 
2997
- $target.stop().slideDown(this.options.slideSpeed, () => {
3068
+ $target.finish().slideDown(this.options.slideSpeed, () => {
2998
3069
  /**
2999
3070
  * Fires when the tab is done opening.
3000
3071
  * @event Accordion#down
@@ -3018,11 +3089,10 @@ class Accordion extends Plugin {
3018
3089
  $targetItem.removeClass('is-active');
3019
3090
 
3020
3091
  $(`#${targetContentId}`).attr({
3021
- 'aria-expanded': false,
3022
- 'aria-selected': false
3092
+ 'aria-expanded': false
3023
3093
  });
3024
3094
 
3025
- $target.stop().slideUp(this.options.slideSpeed, () => {
3095
+ $target.finish().slideUp(this.options.slideSpeed, () => {
3026
3096
  /**
3027
3097
  * Fires when the tab is done collapsing up.
3028
3098
  * @event Accordion#up
@@ -3166,7 +3236,6 @@ class AccordionMenu extends Plugin {
3166
3236
 
3167
3237
  this.$element.find('[data-submenu]').not('.is-active').slideUp(0);//.find('a').css('padding-left', '1rem');
3168
3238
  this.$element.attr({
3169
- 'role': 'tree',
3170
3239
  'aria-multiselectable': this.options.multiOpen
3171
3240
  });
3172
3241
 
@@ -3200,9 +3269,6 @@ class AccordionMenu extends Plugin {
3200
3269
  'id': subId
3201
3270
  });
3202
3271
  });
3203
- this.$element.find('li').attr({
3204
- 'role': 'treeitem'
3205
- });
3206
3272
  var initPanes = this.$element.find('.is-active');
3207
3273
  if (initPanes.length) {
3208
3274
  initPanes.each(function() {
@@ -3224,7 +3290,7 @@ class AccordionMenu extends Plugin {
3224
3290
 
3225
3291
  if ($submenu.length) {
3226
3292
  if (_this.options.submenuToggle) {
3227
- $(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function(e) {
3293
+ $(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function() {
3228
3294
  _this.toggle($submenu);
3229
3295
  });
3230
3296
  } else {
@@ -3493,8 +3559,6 @@ class Drilldown extends Plugin {
3493
3559
  'ARROW_DOWN': 'down',
3494
3560
  'ARROW_LEFT': 'previous',
3495
3561
  'ESCAPE': 'close',
3496
- 'TAB': 'down',
3497
- 'SHIFT_TAB': 'up'
3498
3562
  });
3499
3563
  }
3500
3564
 
@@ -3510,12 +3574,11 @@ class Drilldown extends Plugin {
3510
3574
  }
3511
3575
 
3512
3576
  this.$element.attr({
3513
- 'role': 'tree',
3514
3577
  'aria-multiselectable': false
3515
3578
  });
3516
3579
  this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
3517
3580
  this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
3518
- this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a');
3581
+ this.$menuItems = this.$element.find('li').not('.js-drilldown-back').find('a');
3519
3582
 
3520
3583
  // Set the main menu as current by default (unless a submenu is selected)
3521
3584
  // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu
@@ -3559,7 +3622,7 @@ class Drilldown extends Plugin {
3559
3622
  this.$submenus.each(function(){
3560
3623
  var $menu = $(this),
3561
3624
  $back = $menu.find('.js-drilldown-back');
3562
- if(!$back.length){
3625
+ if(!$back.length) {
3563
3626
  switch (_this.options.backButtonPosition) {
3564
3627
  case "bottom":
3565
3628
  $menu.append(_this.options.backButton);
@@ -3606,7 +3669,7 @@ class Drilldown extends Plugin {
3606
3669
  var _this = this;
3607
3670
 
3608
3671
  $elem.off('click.zf.drilldown')
3609
- .on('click.zf.drilldown', function(e){
3672
+ .on('click.zf.drilldown', function(e) {
3610
3673
  if($(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')){
3611
3674
  e.preventDefault();
3612
3675
  }
@@ -3618,9 +3681,9 @@ class Drilldown extends Plugin {
3618
3681
 
3619
3682
  if(_this.options.closeOnClick){
3620
3683
  var $body = $('body');
3621
- $body.off('.zf.drilldown').on('click.zf.drilldown', function(e){
3622
- if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; }
3623
- e.preventDefault();
3684
+ $body.off('.zf.drilldown').on('click.zf.drilldown', function(ev) {
3685
+ if (ev.target === _this.$element[0] || $.contains(_this.$element[0], ev.target)) { return; }
3686
+ ev.preventDefault();
3624
3687
  _this._hideAll();
3625
3688
  $body.off('.zf.drilldown');
3626
3689
  });
@@ -3648,7 +3711,7 @@ class Drilldown extends Plugin {
3648
3711
  */
3649
3712
  _scrollTop() {
3650
3713
  var _this = this;
3651
- var $scrollTopElement = _this.options.scrollTopElement!=''?$(_this.options.scrollTopElement):_this.$element,
3714
+ var $scrollTopElement = _this.options.scrollTopElement !== ''?$(_this.options.scrollTopElement):_this.$element,
3652
3715
  scrollPos = parseInt($scrollTopElement.offset().top+_this.options.scrollTopOffset, 10);
3653
3716
  $('html, body').stop(true).animate({ scrollTop: scrollPos }, _this.options.animationDuration, _this.options.animationEasing,function(){
3654
3717
  /**
@@ -3753,6 +3816,7 @@ class Drilldown extends Plugin {
3753
3816
  _hideAll() {
3754
3817
  var $elem = this.$element.find('.is-drilldown-submenu.is-active');
3755
3818
  $elem.addClass('is-closing');
3819
+ $elem.parent().closest('ul').removeClass('invisible');
3756
3820
 
3757
3821
  if (this.options.autoHeight) {
3758
3822
  const calcHeight = $elem.parent().closest('ul').data('calcHeight');
@@ -3786,8 +3850,7 @@ class Drilldown extends Plugin {
3786
3850
  var _this = this;
3787
3851
  $elem.off('click.zf.drilldown');
3788
3852
  $elem.children('.js-drilldown-back')
3789
- .on('click.zf.drilldown', function(e){
3790
- // console.log('mouseup on back');
3853
+ .on('click.zf.drilldown', function() {
3791
3854
  _this._hide($elem);
3792
3855
 
3793
3856
  // If there is a parent submenu, call show
@@ -3795,6 +3858,9 @@ class Drilldown extends Plugin {
3795
3858
  if (parentSubMenu.length) {
3796
3859
  _this._show(parentSubMenu);
3797
3860
  }
3861
+ else {
3862
+ _this.$currentMenu = _this.$element;
3863
+ }
3798
3864
  });
3799
3865
  }
3800
3866
 
@@ -3807,8 +3873,8 @@ class Drilldown extends Plugin {
3807
3873
  var _this = this;
3808
3874
  this.$menuItems.not('.is-drilldown-submenu-parent')
3809
3875
  .off('click.zf.drilldown')
3810
- .on('click.zf.drilldown', function(e){
3811
- setTimeout(function(){
3876
+ .on('click.zf.drilldown', function() {
3877
+ setTimeout(function() {
3812
3878
  _this._hideAll();
3813
3879
  }, 0);
3814
3880
  });
@@ -3858,7 +3924,7 @@ class Drilldown extends Plugin {
3858
3924
 
3859
3925
  // Reset drilldown
3860
3926
  var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]');
3861
- $expandedSubmenus.each(function(index) {
3927
+ $expandedSubmenus.each(function() {
3862
3928
  _this._setHideSubMenuClasses($(this));
3863
3929
  });
3864
3930
 
@@ -3867,7 +3933,7 @@ class Drilldown extends Plugin {
3867
3933
 
3868
3934
  // If target menu is root, focus first link & exit
3869
3935
  if ($elem.is('[data-drilldown]')) {
3870
- if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus();
3936
+ if (autoFocus === true) $elem.find('li > a').first().focus();
3871
3937
  if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));
3872
3938
  return;
3873
3939
  }
@@ -3883,14 +3949,14 @@ class Drilldown extends Plugin {
3883
3949
  _this.$wrapper.css('height', $(this).data('calcHeight'));
3884
3950
  }
3885
3951
 
3886
- var isLastChild = index == $submenus.length - 1;
3952
+ var isLastChild = index === $submenus.length - 1;
3887
3953
 
3888
3954
  // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link
3889
3955
  // Last child makes sure the event gets always triggered even if going through several menus
3890
3956
  if (isLastChild === true) {
3891
3957
  $(this).one(transitionend($(this)), () => {
3892
3958
  if (autoFocus === true) {
3893
- $elem.find('li[role="treeitem"] > a').first().focus();
3959
+ $elem.find('li > a').first().focus();
3894
3960
  }
3895
3961
  });
3896
3962
  }
@@ -3911,7 +3977,14 @@ class Drilldown extends Plugin {
3911
3977
  $elem.attr('aria-expanded', true);
3912
3978
 
3913
3979
  this.$currentMenu = $submenu;
3914
- $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
3980
+
3981
+ //hide drilldown parent menu when submenu is open
3982
+ // this removes it from the dom so that the tab key will take the user to the next visible element
3983
+ $elem.parent().closest('ul').addClass('invisible');
3984
+
3985
+ // add visible class to submenu to override invisible class above
3986
+ $submenu.addClass('is-active visible').removeClass('invisible').attr('aria-hidden', false);
3987
+
3915
3988
  if (this.options.autoHeight) {
3916
3989
  this.$wrapper.css({ height: $submenu.data('calcHeight') });
3917
3990
  }
@@ -3931,11 +4004,12 @@ class Drilldown extends Plugin {
3931
4004
  */
3932
4005
  _hide($elem) {
3933
4006
  if(this.options.autoHeight) this.$wrapper.css({height:$elem.parent().closest('ul').data('calcHeight')});
4007
+ $elem.parent().closest('ul').removeClass('invisible');
3934
4008
  $elem.parent('li').attr('aria-expanded', false);
3935
4009
  $elem.attr('aria-hidden', true);
3936
4010
  $elem.addClass('is-closing')
3937
4011
  .one(transitionend($elem), function(){
3938
- $elem.removeClass('is-active is-closing');
4012
+ $elem.removeClass('is-active is-closing visible');
3939
4013
  $elem.blur().addClass('invisible');
3940
4014
  });
3941
4015
  /**
@@ -3956,7 +4030,6 @@ class Drilldown extends Plugin {
3956
4030
 
3957
4031
  // Recalculate menu heights and total max height
3958
4032
  this.$submenus.add(this.$element).each(function(){
3959
- var numOfElems = $(this).children('li').length;
3960
4033
  var height = Box.GetDimensions(this).height;
3961
4034
 
3962
4035
  maxHeight = height > maxHeight ? height : maxHeight;
@@ -3967,7 +4040,7 @@ class Drilldown extends Plugin {
3967
4040
  });
3968
4041
 
3969
4042
  if (this.options.autoHeight)
3970
- result['height'] = this.$currentMenu.data('calcHeight');
4043
+ result.height = this.$currentMenu.data('calcHeight');
3971
4044
  else
3972
4045
  result['min-height'] = `${maxHeight}px`;
3973
4046
 
@@ -3981,13 +4054,14 @@ class Drilldown extends Plugin {
3981
4054
  * @function
3982
4055
  */
3983
4056
  _destroy() {
4057
+ $('body').off('.zf.drilldown');
3984
4058
  if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);
3985
4059
  this._hideAll();
3986
4060
  this.$element.off('mutateme.zf.trigger');
3987
4061
  Nest.Burn(this.$element, 'drilldown');
3988
4062
  this.$element.unwrap()
3989
4063
  .find('.js-drilldown-back, .is-submenu-parent-item').remove()
3990
- .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')
4064
+ .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').off('transitionend otransitionend webkitTransitionEnd')
3991
4065
  .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');
3992
4066
  this.$submenuAnchors.each(function() {
3993
4067
  $(this).off('.zf.drilldown');
@@ -4001,7 +4075,7 @@ class Drilldown extends Plugin {
4001
4075
  $link.removeAttr('tabindex');
4002
4076
  if($link.data('savedHref')){
4003
4077
  $link.attr('href', $link.data('savedHref')).removeData('savedHref');
4004
- }else{ return; }
4078
+ }else { return; }
4005
4079
  });
4006
4080
  };
4007
4081
  }
@@ -4198,7 +4272,7 @@ class Positionable extends Plugin {
4198
4272
  }
4199
4273
 
4200
4274
  _alignmentsExhausted(position) {
4201
- return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length;
4275
+ return this.triedPositions[position] && this.triedPositions[position].length === ALIGNMENTS[position].length;
4202
4276
  }
4203
4277
 
4204
4278
 
@@ -4361,7 +4435,7 @@ class Dropdown extends Positionable {
4361
4435
 
4362
4436
  if(this.options.parentClass){
4363
4437
  this.$parent = this.$element.parents('.' + this.options.parentClass);
4364
- }else{
4438
+ }else {
4365
4439
  this.$parent = null;
4366
4440
  }
4367
4441
 
@@ -4496,8 +4570,7 @@ class Dropdown extends Positionable {
4496
4570
  }
4497
4571
  this.$anchors.add(this.$element).on('keydown.zf.dropdown', function(e) {
4498
4572
 
4499
- var $target = $(this),
4500
- visibleFocusableElements = Keyboard.findFocusable(_this.$element);
4573
+ var $target = $(this);
4501
4574
 
4502
4575
  Keyboard.handleKey(e, 'Dropdown', {
4503
4576
  open: function() {
@@ -4612,7 +4685,7 @@ class Dropdown extends Positionable {
4612
4685
  if(this.$element.hasClass('is-open')){
4613
4686
  if(this.$anchors.data('hover')) return;
4614
4687
  this.close();
4615
- }else{
4688
+ }else {
4616
4689
  this.open();
4617
4690
  }
4618
4691
  }
@@ -4855,7 +4928,7 @@ class DropdownMenu extends Plugin {
4855
4928
 
4856
4929
  // Handle Leaf element Clicks
4857
4930
  if(_this.options.closeOnClickInside){
4858
- this.$menuItems.on('click.zf.dropdownMenu', function(e) {
4931
+ this.$menuItems.on('click.zf.dropdownMenu', function() {
4859
4932
  var $elem = $(this),
4860
4933
  hasSub = $elem.hasClass(parClass);
4861
4934
  if(!hasSub){
@@ -4864,8 +4937,10 @@ class DropdownMenu extends Plugin {
4864
4937
  });
4865
4938
  }
4866
4939
 
4940
+ if (hasTouch && this.options.disableHoverOnTouch) this.options.disableHover = true;
4941
+
4867
4942
  if (!this.options.disableHover) {
4868
- this.$menuItems.on('mouseenter.zf.dropdownMenu', function (e) {
4943
+ this.$menuItems.on('mouseenter.zf.dropdownMenu', function () {
4869
4944
  var $elem = $(this),
4870
4945
  hasSub = $elem.hasClass(parClass);
4871
4946
 
@@ -4875,7 +4950,7 @@ class DropdownMenu extends Plugin {
4875
4950
  _this._show($elem.children('.is-dropdown-submenu'));
4876
4951
  }, _this.options.hoverDelay));
4877
4952
  }
4878
- }).on('mouseleave.zf.dropdownMenu', ignoreMousedisappear(function (e) {
4953
+ }).on('mouseleave.zf.dropdownMenu', ignoreMousedisappear(function () {
4879
4954
  var $elem = $(this),
4880
4955
  hasSub = $elem.hasClass(parClass);
4881
4956
  if (hasSub && _this.options.autoclose) {
@@ -5063,7 +5138,7 @@ class DropdownMenu extends Plugin {
5063
5138
  if ($elem && $elem.length) {
5064
5139
  $toClose = $elem;
5065
5140
  } else if (typeof idx !== 'undefined') {
5066
- $toClose = this.$tabs.not(function(i, el) {
5141
+ $toClose = this.$tabs.not(function(i) {
5067
5142
  return i === idx;
5068
5143
  });
5069
5144
  }
@@ -5122,6 +5197,13 @@ DropdownMenu.defaults = {
5122
5197
  * @default false
5123
5198
  */
5124
5199
  disableHover: false,
5200
+ /**
5201
+ * Disallows hover on touch devices
5202
+ * @option
5203
+ * @type {boolean}
5204
+ * @default true
5205
+ */
5206
+ disableHoverOnTouch: true,
5125
5207
  /**
5126
5208
  * Allow a submenu to automatically close on a mouseleave event, if not clicked open.
5127
5209
  * @option
@@ -5246,13 +5328,13 @@ class Equalizer extends Plugin {
5246
5328
  if(this.options.equalizeOn){
5247
5329
  tooSmall = this._checkMQ();
5248
5330
  $(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));
5249
- }else{
5331
+ }else {
5250
5332
  this._events();
5251
5333
  }
5252
5334
  if((typeof tooSmall !== 'undefined' && tooSmall === false) || typeof tooSmall === 'undefined'){
5253
5335
  if(imgs.length){
5254
5336
  onImagesLoaded(imgs, this._reflow.bind(this));
5255
- }else{
5337
+ }else {
5256
5338
  this._reflow();
5257
5339
  }
5258
5340
  }
@@ -5275,7 +5357,7 @@ class Equalizer extends Plugin {
5275
5357
  * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound
5276
5358
  * @private
5277
5359
  */
5278
- _onResizeMe(e) {
5360
+ _onResizeMe() {
5279
5361
  this._reflow();
5280
5362
  }
5281
5363
 
@@ -5295,7 +5377,7 @@ class Equalizer extends Plugin {
5295
5377
  this._pauseEvents();
5296
5378
  if(this.hasNested){
5297
5379
  this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);
5298
- }else{
5380
+ }else {
5299
5381
  this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);
5300
5382
  this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);
5301
5383
  }
@@ -5313,7 +5395,7 @@ class Equalizer extends Plugin {
5313
5395
  this._pauseEvents();
5314
5396
  this.$watched.css('height', 'auto');
5315
5397
  }
5316
- }else{
5398
+ }else {
5317
5399
  if(!this.isOn){
5318
5400
  this._events();
5319
5401
  }
@@ -5342,7 +5424,7 @@ class Equalizer extends Plugin {
5342
5424
  }
5343
5425
  if (this.options.equalizeByRow) {
5344
5426
  this.getHeightsByRow(this.applyHeightByRow.bind(this));
5345
- }else{
5427
+ }else {
5346
5428
  this.getHeights(this.applyHeight.bind(this));
5347
5429
  }
5348
5430
  }
@@ -5387,7 +5469,7 @@ class Equalizer extends Plugin {
5387
5469
  this.$watched[i].style.height = 'auto';
5388
5470
  //maybe could use this.$watched[i].offsetTop
5389
5471
  var elOffsetTop = $(this.$watched[i]).offset().top;
5390
- if (elOffsetTop!=lastElTopOffset) {
5472
+ if (elOffsetTop !== lastElTopOffset) {
5391
5473
  group++;
5392
5474
  groups[group] = [];
5393
5475
  lastElTopOffset=elOffsetTop;
@@ -5527,7 +5609,7 @@ class Interchange extends Plugin {
5527
5609
 
5528
5610
  // Triggers init is idempotent, just need to make sure it is initialized
5529
5611
  Triggers.init($);
5530
-
5612
+
5531
5613
  this._init();
5532
5614
  this._events();
5533
5615
  }
@@ -5595,7 +5677,7 @@ class Interchange extends Plugin {
5595
5677
  if (typeof this.options.type === 'undefined')
5596
5678
  this.options.type = 'auto';
5597
5679
  else if (types.indexOf(this.options.type) === -1) {
5598
- console.log(`Warning: invalid value "${this.options.type}" for Interchange option "type"`);
5680
+ console.warn(`Warning: invalid value "${this.options.type}" for Interchange option "type"`);
5599
5681
  this.options.type = 'auto';
5600
5682
  }
5601
5683
  }
@@ -5618,10 +5700,9 @@ class Interchange extends Plugin {
5618
5700
  * Checks the Interchange element for the provided media query + content pairings
5619
5701
  * @function
5620
5702
  * @private
5621
- * @param {Object} element - jQuery object that is an Interchange instance
5622
5703
  * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys
5623
5704
  */
5624
- _generateRules(element) {
5705
+ _generateRules() {
5625
5706
  var rulesList = [];
5626
5707
  var rules;
5627
5708
 
@@ -5981,7 +6062,7 @@ class Magellan extends Plugin {
5981
6062
  });
5982
6063
  });
5983
6064
 
5984
- this._deepLinkScroll = function(e) {
6065
+ this._deepLinkScroll = function() {
5985
6066
  if(_this.options.deepLinking) {
5986
6067
  _this.scrollToLoc(window.location.hash);
5987
6068
  }
@@ -6035,12 +6116,12 @@ class Magellan extends Plugin {
6035
6116
 
6036
6117
  let activeIdx;
6037
6118
  // Before the first point: no link
6038
- if(newScrollPos < this.points[0]);
6119
+ if(newScrollPos < this.points[0] - this.options.offset - (isScrollingUp ? this.options.threshold : 0));
6039
6120
  // At the bottom of the page: last link
6040
6121
  else if(newScrollPos + this.winHeight === this.docHeight){ activeIdx = this.points.length - 1; }
6041
6122
  // Otherwhise, use the last visible link
6042
- else{
6043
- const visibleLinks = this.points.filter((p, i) => {
6123
+ else {
6124
+ const visibleLinks = this.points.filter((p) => {
6044
6125
  return (p - this.options.offset - (isScrollingUp ? this.options.threshold : 0)) <= newScrollPos;
6045
6126
  });
6046
6127
  activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;
@@ -6052,7 +6133,7 @@ class Magellan extends Plugin {
6052
6133
  if(typeof activeIdx !== 'undefined'){
6053
6134
  this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]');
6054
6135
  if (this.$active.length) activeHash = this.$active[0].getAttribute('href');
6055
- }else{
6136
+ }else {
6056
6137
  this.$active = $();
6057
6138
  }
6058
6139
  const isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);
@@ -6071,10 +6152,10 @@ class Magellan extends Plugin {
6071
6152
  const url = activeHash ? activeHash : window.location.pathname + window.location.search;
6072
6153
  if(this.options.updateHistory){
6073
6154
  window.history.pushState({}, '', url);
6074
- }else{
6155
+ }else {
6075
6156
  window.history.replaceState({}, '', url);
6076
6157
  }
6077
- }else{
6158
+ }else {
6078
6159
  window.location.hash = activeHash;
6079
6160
  }
6080
6161
  }
@@ -6475,74 +6556,75 @@ class OffCanvas extends Plugin {
6475
6556
  * @function
6476
6557
  * @private
6477
6558
  */
6478
- _stopScrolling(event) {
6559
+ _stopScrolling() {
6479
6560
  return false;
6480
6561
  }
6481
6562
 
6482
6563
  /**
6483
- * Tag the element given as context whether it can be scrolled up and down.
6484
- * Used to allow or prevent it to scroll. See `_stopScrollPropagation`.
6485
- *
6486
- * Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios
6487
- * Only really works for y, not sure how to extend to x or if we need to.
6488
- *
6489
- * @function
6564
+ * Save current finger y-position
6565
+ * @param event
6490
6566
  * @private
6491
6567
  */
6492
6568
  _recordScrollable(event) {
6493
- let elem = this; // called from event handler context with this as elem
6569
+ const elem = this;
6570
+ elem.lastY = event.touches[0].pageY;
6571
+ }
6494
6572
 
6495
- // If the element is scrollable (content overflows), then...
6496
- if (elem.scrollHeight !== elem.clientHeight) {
6497
- // If we're at the top, scroll down one pixel to allow scrolling up
6498
- if (elem.scrollTop === 0) {
6499
- elem.scrollTop = 1;
6500
- }
6501
- // If we're at the bottom, scroll up one pixel to allow scrolling down
6502
- if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) {
6503
- elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1;
6504
- }
6573
+ /**
6574
+ * Prevent further scrolling when it hits the edges
6575
+ * @param event
6576
+ * @private
6577
+ */
6578
+ _preventDefaultAtEdges(event) {
6579
+ const elem = this;
6580
+ const _this = event.data;
6581
+ const delta = elem.lastY - event.touches[0].pageY;
6582
+ elem.lastY = event.touches[0].pageY;
6583
+
6584
+ if (!_this._canScroll(delta, elem)) {
6585
+ event.preventDefault();
6505
6586
  }
6506
- elem.allowUp = elem.scrollTop > 0;
6507
- elem.allowDown = elem.scrollTop < (elem.scrollHeight - elem.clientHeight);
6508
- elem.lastY = event.originalEvent.pageY;
6509
6587
  }
6510
6588
 
6511
6589
  /**
6512
- * Prevent the given event propagation if the element given as context can scroll.
6513
- * Used to preserve the element scrolling on mobile (`touchmove`) when the document
6514
- * scrolling is prevented. See https://git.io/zf-9707.
6515
- * @function
6590
+ * Handle continuous scrolling of scrollbox
6591
+ * Don't bubble up to _preventDefaultAtEdges
6592
+ * @param event
6516
6593
  * @private
6517
6594
  */
6518
- _stopScrollPropagation(event) {
6519
- let elem = this; // called from event handler context with this as elem
6520
- let parent; // off-canvas elem if called from inner scrollbox
6521
- let up = event.pageY < elem.lastY;
6522
- let down = !up;
6523
- elem.lastY = event.pageY;
6524
-
6525
- if((up && elem.allowUp) || (down && elem.allowDown)) {
6526
- // It is not recommended to stop event propagation (the user cannot watch it),
6527
- // but in this case this is the only solution we have.
6528
- event.stopPropagation();
6529
-
6530
- // If elem is inner scrollbox we are scrolling the outer off-canvas down/up once the box end has been reached
6531
- // This lets the user continue to touch move the off-canvas without the need to place the finger outside the scrollbox
6532
- if (elem.hasAttribute('data-off-canvas-scrollbox')) {
6533
- parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]');
6534
- if (elem.scrollTop <= 1 && parent.scrollTop > 0) {
6535
- parent.scrollTop--;
6536
- } else if (elem.scrollTop >= elem.scrollHeight - elem.clientHeight - 1 && parent.scrollTop < parent.scrollHeight - parent.clientHeight) {
6537
- parent.scrollTop++;
6538
- }
6539
- }
6595
+ _scrollboxTouchMoved(event) {
6596
+ const elem = this;
6597
+ const _this = event.data;
6598
+ const parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]');
6599
+ const delta = elem.lastY - event.touches[0].pageY;
6600
+ parent.lastY = elem.lastY = event.touches[0].pageY;
6540
6601
 
6541
- } else {
6542
- event.preventDefault();
6602
+ event.stopPropagation();
6603
+
6604
+ if (!_this._canScroll(delta, elem)) {
6605
+ if (!_this._canScroll(delta, parent)) {
6606
+ event.preventDefault();
6607
+ } else {
6608
+ parent.scrollTop += delta;
6609
+ }
6543
6610
  }
6544
6611
  }
6545
6612
 
6613
+ /**
6614
+ * Detect possibility of scrolling
6615
+ * @param delta
6616
+ * @param elem
6617
+ * @returns boolean
6618
+ * @private
6619
+ */
6620
+ _canScroll(delta, elem) {
6621
+ const up = delta < 0;
6622
+ const down = delta > 0;
6623
+ const allowUp = elem.scrollTop > 0;
6624
+ const allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight;
6625
+ return up && allowUp || down && allowDown;
6626
+ }
6627
+
6546
6628
  /**
6547
6629
  * Opens the off-canvas menu.
6548
6630
  * @function
@@ -6582,9 +6664,9 @@ class OffCanvas extends Plugin {
6582
6664
  if (this.options.contentScroll === false) {
6583
6665
  $('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling);
6584
6666
  this.$element.on('touchstart', this._recordScrollable);
6585
- this.$element.on('touchmove', this._stopScrollPropagation);
6667
+ this.$element.on('touchmove', this, this._preventDefaultAtEdges);
6586
6668
  this.$element.on('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);
6587
- this.$element.on('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation);
6669
+ this.$element.on('touchmove', '[data-off-canvas-scrollbox]', this, this._scrollboxTouchMoved);
6588
6670
  }
6589
6671
 
6590
6672
  if (this.options.contentOverlay === true) {
@@ -6642,7 +6724,7 @@ class OffCanvas extends Plugin {
6642
6724
  * @fires OffCanvas#close
6643
6725
  * @fires OffCanvas#closed
6644
6726
  */
6645
- close(cb) {
6727
+ close() {
6646
6728
  if (!this.$element.hasClass('is-open') || this.isRevealed) { return; }
6647
6729
 
6648
6730
  /**
@@ -6669,7 +6751,7 @@ class OffCanvas extends Plugin {
6669
6751
 
6670
6752
 
6671
6753
  // Listen to transitionEnd: add class, re-enable scrolling and release focus when done.
6672
- this.$element.one(transitionend(this.$element), (e) => {
6754
+ this.$element.one(transitionend(this.$element), () => {
6673
6755
 
6674
6756
  this.$element.addClass('is-closed');
6675
6757
  this._removeContentClasses();
@@ -6682,9 +6764,9 @@ class OffCanvas extends Plugin {
6682
6764
  if (this.options.contentScroll === false) {
6683
6765
  $('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling);
6684
6766
  this.$element.off('touchstart', this._recordScrollable);
6685
- this.$element.off('touchmove', this._stopScrollPropagation);
6767
+ this.$element.off('touchmove', this._preventDefaultAtEdges);
6686
6768
  this.$element.off('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);
6687
- this.$element.off('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation);
6769
+ this.$element.off('touchmove', '[data-off-canvas-scrollbox]', this._scrollboxTouchMoved);
6688
6770
  }
6689
6771
 
6690
6772
  if (this.options.trapFocus === true) {
@@ -7117,7 +7199,7 @@ class Orbit extends Plugin {
7117
7199
  */
7118
7200
  _reset() {
7119
7201
  // Don't do anything if there are no slides (first run)
7120
- if (typeof this.$slides == 'undefined') {
7202
+ if (typeof this.$slides === 'undefined') {
7121
7203
  return;
7122
7204
  }
7123
7205
 
@@ -7403,7 +7485,7 @@ Orbit.defaults = {
7403
7485
  useMUI: true
7404
7486
  };
7405
7487
 
7406
- let MenuPlugins = {
7488
+ let MenuPlugins$1 = {
7407
7489
  dropdown: {
7408
7490
  cssClass: 'dropdown',
7409
7491
  plugin: DropdownMenu
@@ -7437,7 +7519,7 @@ class ResponsiveMenu extends Plugin {
7437
7519
  * @param {jQuery} element - jQuery object to make into a dropdown menu.
7438
7520
  * @param {Object} options - Overrides to the default plugin settings.
7439
7521
  */
7440
- _setup(element, options) {
7522
+ _setup(element) {
7441
7523
  this.$element = $(element);
7442
7524
  this.rules = this.$element.data('responsive-menu');
7443
7525
  this.currentMq = null;
@@ -7469,8 +7551,8 @@ class ResponsiveMenu extends Plugin {
7469
7551
  let ruleSize = rule.length > 1 ? rule[0] : 'small';
7470
7552
  let rulePlugin = rule.length > 1 ? rule[1] : rule[0];
7471
7553
 
7472
- if (MenuPlugins[rulePlugin] !== null) {
7473
- rulesTree[ruleSize] = MenuPlugins[rulePlugin];
7554
+ if (MenuPlugins$1[rulePlugin] !== null) {
7555
+ rulesTree[ruleSize] = MenuPlugins$1[rulePlugin];
7474
7556
  }
7475
7557
  }
7476
7558
 
@@ -7521,7 +7603,7 @@ class ResponsiveMenu extends Plugin {
7521
7603
  if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;
7522
7604
 
7523
7605
  // Remove existing plugin-specific CSS classes
7524
- $.each(MenuPlugins, function(key, value) {
7606
+ $.each(MenuPlugins$1, function(key, value) {
7525
7607
  _this.$element.removeClass(value.cssClass);
7526
7608
  });
7527
7609
 
@@ -7606,7 +7688,6 @@ class ResponsiveToggle extends Plugin {
7606
7688
  * @private
7607
7689
  */
7608
7690
  _events() {
7609
-
7610
7691
  this._updateMqHandler = this._update.bind(this);
7611
7692
 
7612
7693
  $(window).on('changed.zf.mediaquery', this._updateMqHandler);
@@ -7737,7 +7818,7 @@ class Reveal extends Plugin {
7737
7818
  this.$anchor = $(`[data-open="${this.id}"]`).length ? $(`[data-open="${this.id}"]`) : $(`[data-toggle="${this.id}"]`);
7738
7819
  this.$anchor.attr({
7739
7820
  'aria-controls': this.id,
7740
- 'aria-haspopup': true,
7821
+ 'aria-haspopup': 'dialog',
7741
7822
  'tabindex': 0
7742
7823
  });
7743
7824
 
@@ -7863,9 +7944,9 @@ class Reveal extends Plugin {
7863
7944
  * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.
7864
7945
  * @private
7865
7946
  */
7866
- _handleState(e) {
7947
+ _handleState() {
7867
7948
  if(window.location.hash === ( '#' + this.id) && !this.isActive){ this.open(); }
7868
- else{ this.close(); }
7949
+ else { this.close(); }
7869
7950
  }
7870
7951
 
7871
7952
  /**
@@ -7885,7 +7966,7 @@ class Reveal extends Plugin {
7885
7966
  * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`)
7886
7967
  */
7887
7968
  _enableScroll(scrollTop) {
7888
- scrollTop = scrollTop || parseInt($("html").css("top"));
7969
+ scrollTop = scrollTop || parseInt($("html").css("top"), 10);
7889
7970
  if ($(document).height() > $(window).height()) {
7890
7971
  $("html")
7891
7972
  .css("top", "");
@@ -8120,7 +8201,7 @@ class Reveal extends Plugin {
8120
8201
  // Get the current top before the modal is closed and restore the scroll after.
8121
8202
  // TODO: use component properties instead of HTML properties
8122
8203
  // See https://github.com/foundation/foundation-sites/pull/10786
8123
- var scrollTop = parseInt($("html").css("top"));
8204
+ var scrollTop = parseInt($("html").css("top"), 10);
8124
8205
 
8125
8206
  if ($('.reveal:visible').length === 0) {
8126
8207
  _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
@@ -8336,6 +8417,7 @@ class Slider extends Plugin {
8336
8417
  this.$element = element;
8337
8418
  this.options = $.extend({}, Slider.defaults, this.$element.data(), options);
8338
8419
  this.className = 'Slider'; // ie9 back compat
8420
+ this.initialized = false;
8339
8421
 
8340
8422
  // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.
8341
8423
  Touch.init($);
@@ -8349,18 +8431,18 @@ class Slider extends Plugin {
8349
8431
  'ARROW_UP': 'increase',
8350
8432
  'ARROW_DOWN': 'decrease',
8351
8433
  'ARROW_LEFT': 'decrease',
8352
- 'SHIFT_ARROW_RIGHT': 'increase_fast',
8353
- 'SHIFT_ARROW_UP': 'increase_fast',
8354
- 'SHIFT_ARROW_DOWN': 'decrease_fast',
8355
- 'SHIFT_ARROW_LEFT': 'decrease_fast',
8434
+ 'SHIFT_ARROW_RIGHT': 'increaseFast',
8435
+ 'SHIFT_ARROW_UP': 'increaseFast',
8436
+ 'SHIFT_ARROW_DOWN': 'decreaseFast',
8437
+ 'SHIFT_ARROW_LEFT': 'decreaseFast',
8356
8438
  'HOME': 'min',
8357
8439
  'END': 'max'
8358
8440
  },
8359
8441
  'rtl': {
8360
8442
  'ARROW_LEFT': 'increase',
8361
8443
  'ARROW_RIGHT': 'decrease',
8362
- 'SHIFT_ARROW_LEFT': 'increase_fast',
8363
- 'SHIFT_ARROW_RIGHT': 'decrease_fast'
8444
+ 'SHIFT_ARROW_LEFT': 'increaseFast',
8445
+ 'SHIFT_ARROW_RIGHT': 'decreaseFast'
8364
8446
  }
8365
8447
  });
8366
8448
  }
@@ -8377,6 +8459,7 @@ class Slider extends Plugin {
8377
8459
  this.$handle = this.handles.eq(0);
8378
8460
  this.$input = this.inputs.length ? this.inputs.eq(0) : $(`#${this.$handle.attr('aria-controls')}`);
8379
8461
  this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0);
8462
+
8380
8463
  if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) {
8381
8464
  this.options.disabled = true;
8382
8465
  this.$element.addClass(this.options.disabledClass);
@@ -8405,6 +8488,7 @@ class Slider extends Plugin {
8405
8488
  this.setHandles();
8406
8489
 
8407
8490
  this._events();
8491
+ this.initialized = true;
8408
8492
  }
8409
8493
 
8410
8494
  setHandles() {
@@ -8544,7 +8628,7 @@ class Slider extends Plugin {
8544
8628
  //empty variable, will be used for min-height/width for fill bar
8545
8629
  dim,
8546
8630
  //percentage w/h of the handle compared to the slider bar
8547
- handlePct = ~~(percent(handleDim, elemDim) * 100);
8631
+ handlePct = Math.floor(percent(handleDim, elemDim) * 100);
8548
8632
  //if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar
8549
8633
  if (isLeftHndl) {
8550
8634
  //left or top percentage value to apply to the fill bar.
@@ -8565,14 +8649,6 @@ class Slider extends Plugin {
8565
8649
  css[`min-${hOrW}`] = `${dim}%`;
8566
8650
  }
8567
8651
 
8568
- this.$element.one('finished.zf.animate', function() {
8569
- /**
8570
- * Fires when the handle is done moving.
8571
- * @event Slider#moved
8572
- */
8573
- _this.$element.trigger('moved.zf.slider', [$hndl]);
8574
- });
8575
-
8576
8652
  //because we don't know exactly how the handle will be moved, check the amount of time it should take to move.
8577
8653
  var moveTime = this.$element.data('dragging') ? 1000/60 : this.options.moveTime;
8578
8654
 
@@ -8596,15 +8672,23 @@ class Slider extends Plugin {
8596
8672
  }
8597
8673
  });
8598
8674
 
8599
-
8600
- /**
8601
- * Fires when the value has not been change for a given time.
8602
- * @event Slider#changed
8603
- */
8604
- clearTimeout(_this.timeout);
8605
- _this.timeout = setTimeout(function(){
8606
- _this.$element.trigger('changed.zf.slider', [$hndl]);
8607
- }, _this.options.changedDelay);
8675
+ if (this.initialized) {
8676
+ this.$element.one('finished.zf.animate', function() {
8677
+ /**
8678
+ * Fires when the handle is done moving.
8679
+ * @event Slider#moved
8680
+ */
8681
+ _this.$element.trigger('moved.zf.slider', [$hndl]);
8682
+ });
8683
+ /**
8684
+ * Fires when the value has not been change for a given time.
8685
+ * @event Slider#changed
8686
+ */
8687
+ clearTimeout(_this.timeout);
8688
+ _this.timeout = setTimeout(function(){
8689
+ _this.$element.trigger('changed.zf.slider', [$hndl]);
8690
+ }, _this.options.changedDelay);
8691
+ }
8608
8692
  }
8609
8693
 
8610
8694
  /**
@@ -8717,7 +8801,7 @@ class Slider extends Plugin {
8717
8801
  var val,
8718
8802
  step = this.options.step,
8719
8803
  div = parseFloat(step/2),
8720
- left, prev_val, next_val;
8804
+ left, previousVal, nextVal;
8721
8805
  if (!!$handle) {
8722
8806
  val = parseFloat($handle.attr('aria-valuenow'));
8723
8807
  }
@@ -8729,12 +8813,12 @@ class Slider extends Plugin {
8729
8813
  } else {
8730
8814
  left = step + (val % step);
8731
8815
  }
8732
- prev_val = val - left;
8733
- next_val = prev_val + step;
8816
+ previousVal = val - left;
8817
+ nextVal = previousVal + step;
8734
8818
  if (left === 0) {
8735
8819
  return val;
8736
8820
  }
8737
- val = val >= prev_val + div ? next_val : prev_val;
8821
+ val = val >= previousVal + div ? nextVal : previousVal;
8738
8822
  return val;
8739
8823
  }
8740
8824
 
@@ -8770,7 +8854,7 @@ class Slider extends Plugin {
8770
8854
  // listen for the enter key and trigger a change
8771
8855
  // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events
8772
8856
  this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) {
8773
- if(e.keyCode == 13) handleChangeEvent.call(this, e);
8857
+ if(e.keyCode === 13) handleChangeEvent.call(this, e);
8774
8858
  });
8775
8859
 
8776
8860
  this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent);
@@ -8802,12 +8886,12 @@ class Slider extends Plugin {
8802
8886
 
8803
8887
  curHandle = $(e.currentTarget);
8804
8888
 
8805
- $body.on('mousemove.zf.slider', function(e) {
8806
- e.preventDefault();
8807
- _this._handleEvent(e, curHandle);
8889
+ $body.on('mousemove.zf.slider', function(ev) {
8890
+ ev.preventDefault();
8891
+ _this._handleEvent(ev, curHandle);
8808
8892
 
8809
- }).on('mouseup.zf.slider', function(e) {
8810
- _this._handleEvent(e, curHandle);
8893
+ }).on('mouseup.zf.slider', function(ev) {
8894
+ _this._handleEvent(ev, curHandle);
8811
8895
 
8812
8896
  $handle.removeClass('is-dragging');
8813
8897
  _this.$fill.removeClass('is-dragging');
@@ -8823,9 +8907,9 @@ class Slider extends Plugin {
8823
8907
  }
8824
8908
 
8825
8909
  $handle.off('keydown.zf.slider').on('keydown.zf.slider', function(e) {
8826
- var _$handle = $(this),
8827
- idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0,
8828
- oldValue = parseFloat(_this.inputs.eq(idx).val()),
8910
+ var _$handle = $(this);
8911
+ _this.options.doubleSided ? _this.handles.index(_$handle) : 0;
8912
+ var oldValue = parseFloat($handle.attr('aria-valuenow')),
8829
8913
  newValue;
8830
8914
 
8831
8915
  // handle keyboard event with keyboard util
@@ -8836,10 +8920,10 @@ class Slider extends Plugin {
8836
8920
  increase: function() {
8837
8921
  newValue = oldValue + _this.options.step;
8838
8922
  },
8839
- decrease_fast: function() {
8923
+ decreaseFast: function() {
8840
8924
  newValue = oldValue - _this.options.step * 10;
8841
8925
  },
8842
- increase_fast: function() {
8926
+ increaseFast: function() {
8843
8927
  newValue = oldValue + _this.options.step * 10;
8844
8928
  },
8845
8929
  min: function() {
@@ -9075,7 +9159,7 @@ class Sticky extends Plugin {
9075
9159
  this.isStuck = false;
9076
9160
  this.onLoadListener = onLoad($(window), function () {
9077
9161
  //We calculate the container height to have correct values for anchor points offset calculation.
9078
- _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height;
9162
+ _this.containerHeight = _this.$element.css("display") === "none" ? 0 : _this.$element[0].getBoundingClientRect().height;
9079
9163
  _this.$container.css('height', _this.containerHeight);
9080
9164
  _this.elemHeight = _this.containerHeight;
9081
9165
  if (_this.options.anchor !== '') {
@@ -9102,8 +9186,8 @@ class Sticky extends Plugin {
9102
9186
  * @private
9103
9187
  */
9104
9188
  _parsePoints() {
9105
- var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor,
9106
- btm = this.options.btmAnchor== "" ? document.documentElement.scrollHeight : this.options.btmAnchor,
9189
+ var top = this.options.topAnchor === "" ? 1 : this.options.topAnchor,
9190
+ btm = this.options.btmAnchor === "" ? document.documentElement.scrollHeight : this.options.btmAnchor,
9107
9191
  pts = [top, btm],
9108
9192
  breaks = {};
9109
9193
  for (var i = 0, len = pts.length; i < len && pts[i]; i++) {
@@ -9139,7 +9223,7 @@ class Sticky extends Plugin {
9139
9223
  if (this.canStick) {
9140
9224
  this.isOn = true;
9141
9225
  $(window).off(scrollListener)
9142
- .on(scrollListener, function(e) {
9226
+ .on(scrollListener, function() {
9143
9227
  if (_this.scrollCount === 0) {
9144
9228
  _this.scrollCount = _this.options.checkEvery;
9145
9229
  _this._setSizes(function() {
@@ -9153,16 +9237,16 @@ class Sticky extends Plugin {
9153
9237
  }
9154
9238
 
9155
9239
  this.$element.off('resizeme.zf.trigger')
9156
- .on('resizeme.zf.trigger', function(e, el) {
9240
+ .on('resizeme.zf.trigger', function() {
9157
9241
  _this._eventsHandler(id);
9158
9242
  });
9159
9243
 
9160
- this.$element.on('mutateme.zf.trigger', function (e, el) {
9244
+ this.$element.on('mutateme.zf.trigger', function () {
9161
9245
  _this._eventsHandler(id);
9162
9246
  });
9163
9247
 
9164
9248
  if(this.$anchor) {
9165
- this.$anchor.on('mutateme.zf.trigger', function (e, el) {
9249
+ this.$anchor.on('mutateme.zf.trigger', function () {
9166
9250
  _this._eventsHandler(id);
9167
9251
  });
9168
9252
  }
@@ -9291,11 +9375,11 @@ class Sticky extends Plugin {
9291
9375
 
9292
9376
  css[mrgn] = 0;
9293
9377
 
9294
- css['bottom'] = 'auto';
9378
+ css.bottom = 'auto';
9295
9379
  if(isTop) {
9296
- css['top'] = 0;
9380
+ css.top = 0;
9297
9381
  } else {
9298
- css['top'] = anchorPt;
9382
+ css.top = anchorPt;
9299
9383
  }
9300
9384
 
9301
9385
  this.isStuck = false;
@@ -9323,9 +9407,9 @@ class Sticky extends Plugin {
9323
9407
  }
9324
9408
 
9325
9409
  var newElemWidth = this.$container[0].getBoundingClientRect().width,
9326
- comp = window.getComputedStyle(this.$container[0]),
9327
- pdngl = parseInt(comp['padding-left'], 10),
9328
- pdngr = parseInt(comp['padding-right'], 10);
9410
+ comp = window.getComputedStyle(this.$container[0]),
9411
+ pdngl = parseInt(comp['padding-left'], 10),
9412
+ pdngr = parseInt(comp['padding-right'], 10);
9329
9413
 
9330
9414
  if (this.$anchor && this.$anchor.length) {
9331
9415
  this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;
@@ -9341,7 +9425,7 @@ class Sticky extends Plugin {
9341
9425
  if (this.options.dynamicHeight || !this.containerHeight) {
9342
9426
  // Get the sticked element height and apply it to the container to "hold the place"
9343
9427
  var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;
9344
- newContainerHeight = this.$element.css("display") == "none" ? 0 : newContainerHeight;
9428
+ newContainerHeight = this.$element.css("display") === "none" ? 0 : newContainerHeight;
9345
9429
  this.$container.css('height', newContainerHeight);
9346
9430
  this.containerHeight = newContainerHeight;
9347
9431
  }
@@ -9384,7 +9468,7 @@ class Sticky extends Plugin {
9384
9468
  } else if (this.options.stickTo === 'bottom') {
9385
9469
  topPoint -= (winHeight - (elemHeight + mBtm));
9386
9470
  bottomPoint -= (winHeight - mBtm);
9387
- }
9471
+ } else ;
9388
9472
 
9389
9473
  this.topPoint = topPoint;
9390
9474
  this.bottomPoint = bottomPoint;
@@ -9649,7 +9733,7 @@ class Tabs extends Plugin {
9649
9733
  // Roll up a little to show the titles
9650
9734
  if (this.options.deepLinkSmudge) {
9651
9735
  var offset = this.$element.offset();
9652
- $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay);
9736
+ $('html, body').animate({ scrollTop: offset.top - this.options.deepLinkSmudgeOffset}, this.options.deepLinkSmudgeDelay);
9653
9737
  }
9654
9738
 
9655
9739
  /**
@@ -9788,9 +9872,9 @@ class Tabs extends Plugin {
9788
9872
  //either replace or update browser history
9789
9873
  if (this.options.deepLink && !historyHandled) {
9790
9874
  if (this.options.updateHistory) {
9791
- history.pushState({}, '', anchor);
9875
+ history.pushState({}, '', location.pathname + location.search + anchor);
9792
9876
  } else {
9793
- history.replaceState({}, '', anchor);
9877
+ history.replaceState({}, '', location.pathname + location.search + anchor);
9794
9878
  }
9795
9879
  }
9796
9880
 
@@ -9831,7 +9915,7 @@ class Tabs extends Plugin {
9831
9915
  * @function
9832
9916
  */
9833
9917
  _collapseTab($target) {
9834
- var $target_anchor = $target
9918
+ var $targetAnchor = $target
9835
9919
  .removeClass(`${this.options.linkActiveClass}`)
9836
9920
  .find('[role="tab"]')
9837
9921
  .attr({
@@ -9839,7 +9923,7 @@ class Tabs extends Plugin {
9839
9923
  'tabindex': -1
9840
9924
  });
9841
9925
 
9842
- $(`#${$target_anchor.attr('aria-controls')}`)
9926
+ $(`#${$targetAnchor.attr('aria-controls')}`)
9843
9927
  .removeClass(`${this.options.panelActiveClass}`)
9844
9928
  .attr({ 'aria-hidden': 'true' });
9845
9929
  }
@@ -9902,9 +9986,13 @@ class Tabs extends Plugin {
9902
9986
  var max = 0,
9903
9987
  _this = this; // Lock down the `this` value for the root tabs object
9904
9988
 
9989
+ if (!this.$tabContent) {
9990
+ return;
9991
+ }
9992
+
9905
9993
  this.$tabContent
9906
9994
  .find(`.${this.options.panelClass}`)
9907
- .css('height', '')
9995
+ .css('min-height', '')
9908
9996
  .each(function() {
9909
9997
 
9910
9998
  var panel = $(this),
@@ -9925,7 +10013,7 @@ class Tabs extends Plugin {
9925
10013
 
9926
10014
  max = temp > max ? temp : max;
9927
10015
  })
9928
- .css('height', `${max}px`);
10016
+ .css('min-height', `${max}px`);
9929
10017
  }
9930
10018
 
9931
10019
  /**
@@ -9981,6 +10069,14 @@ Tabs.defaults = {
9981
10069
  */
9982
10070
  deepLinkSmudgeDelay: 300,
9983
10071
 
10072
+ /**
10073
+ * If `deepLinkSmudge` is enabled, animation offset from the top for the deep link adjustment
10074
+ * @option
10075
+ * @type {number}
10076
+ * @default 0
10077
+ */
10078
+ deepLinkSmudgeOffset: 0,
10079
+
9984
10080
  /**
9985
10081
  * If `deepLink` is enabled, update the browser history with the open tab
9986
10082
  * @option
@@ -10109,7 +10205,7 @@ class Toggler extends Plugin {
10109
10205
  else {
10110
10206
  input = this.options.toggler;
10111
10207
  if (typeof input !== 'string' || !input.length) {
10112
- throw new Error(`The 'toogler' option containing the target class is required, got "${input}"`);
10208
+ throw new Error(`The 'toggler' option containing the target class is required, got "${input}"`);
10113
10209
  }
10114
10210
  // Allow for a . at the beginning of the string
10115
10211
  this.className = input[0] === '.' ? input.slice(1) : input;
@@ -10371,7 +10467,6 @@ class Tooltip extends Positionable {
10371
10467
  'aria-hidden': false
10372
10468
  });
10373
10469
  _this.isActive = true;
10374
- // console.log(this.template);
10375
10470
  this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {
10376
10471
  //maybe do stuff?
10377
10472
  });
@@ -10388,7 +10483,6 @@ class Tooltip extends Positionable {
10388
10483
  * @function
10389
10484
  */
10390
10485
  hide() {
10391
- // console.log('hiding', this.$element.data('yeti-box'));
10392
10486
  var _this = this;
10393
10487
  this.template.stop().attr({
10394
10488
  'aria-hidden': true,
@@ -10412,7 +10506,6 @@ class Tooltip extends Positionable {
10412
10506
  _events() {
10413
10507
  const _this = this;
10414
10508
  const hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined');
10415
- const $template = this.template;
10416
10509
  var isFocus = false;
10417
10510
 
10418
10511
  // `disableForTouch: Fully disable the tooltip on touch devices
@@ -10420,14 +10513,14 @@ class Tooltip extends Positionable {
10420
10513
 
10421
10514
  if (!this.options.disableHover) {
10422
10515
  this.$element
10423
- .on('mouseenter.zf.tooltip', function(e) {
10516
+ .on('mouseenter.zf.tooltip', function() {
10424
10517
  if (!_this.isActive) {
10425
10518
  _this.timeout = setTimeout(function() {
10426
10519
  _this.show();
10427
10520
  }, _this.options.hoverDelay);
10428
10521
  }
10429
10522
  })
10430
- .on('mouseleave.zf.tooltip', ignoreMousedisappear(function(e) {
10523
+ .on('mouseleave.zf.tooltip', ignoreMousedisappear(function() {
10431
10524
  clearTimeout(_this.timeout);
10432
10525
  if (!isFocus || (_this.isClick && !_this.options.clickOpen)) {
10433
10526
  _this.hide();
@@ -10437,13 +10530,13 @@ class Tooltip extends Positionable {
10437
10530
 
10438
10531
  if (hasTouch) {
10439
10532
  this.$element
10440
- .on('tap.zf.tooltip touchend.zf.tooltip', function (e) {
10533
+ .on('tap.zf.tooltip touchend.zf.tooltip', function () {
10441
10534
  _this.isActive ? _this.hide() : _this.show();
10442
10535
  });
10443
10536
  }
10444
10537
 
10445
10538
  if (this.options.clickOpen) {
10446
- this.$element.on('mousedown.zf.tooltip', function(e) {
10539
+ this.$element.on('mousedown.zf.tooltip', function() {
10447
10540
  if (_this.isClick) ; else {
10448
10541
  _this.isClick = true;
10449
10542
  if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {
@@ -10452,7 +10545,7 @@ class Tooltip extends Positionable {
10452
10545
  }
10453
10546
  });
10454
10547
  } else {
10455
- this.$element.on('mousedown.zf.tooltip', function(e) {
10548
+ this.$element.on('mousedown.zf.tooltip', function() {
10456
10549
  _this.isClick = true;
10457
10550
  });
10458
10551
  }
@@ -10464,7 +10557,7 @@ class Tooltip extends Positionable {
10464
10557
  });
10465
10558
 
10466
10559
  this.$element
10467
- .on('focus.zf.tooltip', function(e) {
10560
+ .on('focus.zf.tooltip', function() {
10468
10561
  isFocus = true;
10469
10562
  if (_this.isClick) {
10470
10563
  // If we're not showing open on clicks, we need to pretend a click-launched focus isn't
@@ -10476,7 +10569,7 @@ class Tooltip extends Positionable {
10476
10569
  }
10477
10570
  })
10478
10571
 
10479
- .on('focusout.zf.tooltip', function(e) {
10572
+ .on('focusout.zf.tooltip', function() {
10480
10573
  isFocus = false;
10481
10574
  _this.isClick = false;
10482
10575
  _this.hide();
@@ -10675,7 +10768,7 @@ Tooltip.defaults = {
10675
10768
  };
10676
10769
 
10677
10770
  // The plugin matches the plugin classes with these plugin instances.
10678
- var MenuPlugins$1 = {
10771
+ var MenuPlugins = {
10679
10772
  tabs: {
10680
10773
  cssClass: 'tabs',
10681
10774
  plugin: Tabs,
@@ -10754,8 +10847,8 @@ class ResponsiveAccordionTabs extends Plugin{
10754
10847
  let ruleSize = rule.length > 1 ? rule[0] : 'small';
10755
10848
  let rulePlugin = rule.length > 1 ? rule[1] : rule[0];
10756
10849
 
10757
- if (MenuPlugins$1[rulePlugin] !== null) {
10758
- rulesTree[ruleSize] = MenuPlugins$1[rulePlugin];
10850
+ if (MenuPlugins[rulePlugin] !== null) {
10851
+ rulesTree[ruleSize] = MenuPlugins[rulePlugin];
10759
10852
  }
10760
10853
  }
10761
10854
 
@@ -10773,9 +10866,9 @@ class ResponsiveAccordionTabs extends Plugin{
10773
10866
  //get all defaults and options
10774
10867
  var _this = this;
10775
10868
  _this.allOptions = {};
10776
- for (var key in MenuPlugins$1) {
10777
- if (MenuPlugins$1.hasOwnProperty(key)) {
10778
- var obj = MenuPlugins$1[key];
10869
+ for (var key in MenuPlugins) {
10870
+ if (MenuPlugins.hasOwnProperty(key)) {
10871
+ var obj = MenuPlugins[key];
10779
10872
  try {
10780
10873
  var dummyPlugin = $('<ul></ul>');
10781
10874
  var tmpPlugin = new obj.plugin(dummyPlugin,_this.options);
@@ -10788,6 +10881,7 @@ class ResponsiveAccordionTabs extends Plugin{
10788
10881
  tmpPlugin.destroy();
10789
10882
  }
10790
10883
  catch(e) {
10884
+ console.warn(`Warning: Problems getting Accordion/Tab options: ${e}`);
10791
10885
  }
10792
10886
  }
10793
10887
  }
@@ -10824,7 +10918,7 @@ class ResponsiveAccordionTabs extends Plugin{
10824
10918
  if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;
10825
10919
 
10826
10920
  // Remove existing plugin-specific CSS classes
10827
- $.each(MenuPlugins$1, function(key, value) {
10921
+ $.each(MenuPlugins, function(key, value) {
10828
10922
  _this.$element.removeClass(value.cssClass);
10829
10923
  });
10830
10924
 
@@ -10912,7 +11006,7 @@ class ResponsiveAccordionTabs extends Plugin{
10912
11006
  * @see Tabs.selectTab
10913
11007
  * @function
10914
11008
  */
10915
- open(_target) {
11009
+ open() {
10916
11010
  if (this.currentRule && typeof this.currentRule.open === 'function') {
10917
11011
  return this.currentRule.open(this.currentPlugin, ...arguments);
10918
11012
  }
@@ -10924,7 +11018,7 @@ class ResponsiveAccordionTabs extends Plugin{
10924
11018
  * @see Accordion.up
10925
11019
  * @function
10926
11020
  */
10927
- close(_target) {
11021
+ close() {
10928
11022
  if (this.currentRule && typeof this.currentRule.close === 'function') {
10929
11023
  return this.currentRule.close(this.currentPlugin, ...arguments);
10930
11024
  }
@@ -10936,7 +11030,7 @@ class ResponsiveAccordionTabs extends Plugin{
10936
11030
  * @see Accordion.toggle
10937
11031
  * @function
10938
11032
  */
10939
- toggle(_target) {
11033
+ toggle() {
10940
11034
  if (this.currentRule && typeof this.currentRule.toggle === 'function') {
10941
11035
  return this.currentRule.toggle(this.currentPlugin, ...arguments);
10942
11036
  }
@@ -11001,6 +11095,5 @@ Foundation.plugin(Toggler, 'Toggler');
11001
11095
  Foundation.plugin(Tooltip, 'Tooltip');
11002
11096
  Foundation.plugin(ResponsiveAccordionTabs, 'ResponsiveAccordionTabs');
11003
11097
 
11004
- export default Foundation;
11005
- export { Abide, Accordion, AccordionMenu, Box, Foundation as Core, foundation_core_utils as CoreUtils, Drilldown, Dropdown, DropdownMenu, Equalizer, Foundation, Interchange, Keyboard, Magellan, MediaQuery, Motion, Move, Nest, OffCanvas, Orbit, ResponsiveAccordionTabs, ResponsiveMenu, ResponsiveToggle, Reveal, Slider, SmoothScroll, Sticky, Tabs, Timer, Toggler, Tooltip, Touch, Triggers, onImagesLoaded };
11098
+ export { Abide, Accordion, AccordionMenu, Box, Foundation as Core, foundation_core_utils as CoreUtils, Drilldown, Dropdown, DropdownMenu, Equalizer, Foundation, Interchange, Keyboard, Magellan, MediaQuery, Motion, Move, Nest, OffCanvas, Orbit, ResponsiveAccordionTabs, ResponsiveMenu, ResponsiveToggle, Reveal, Slider, SmoothScroll, Sticky, Tabs, Timer, Toggler, Tooltip, Touch, Triggers, Foundation as default, onImagesLoaded };
11006
11099
  //# sourceMappingURL=foundation.es6.js.map