1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // identity function for calling harmony imports with the correct context 37/******/ __webpack_require__.i = function(value) { return value; }; 38/******/ 39/******/ // define getter function for harmony exports 40/******/ __webpack_require__.d = function(exports, name, getter) { 41/******/ if(!__webpack_require__.o(exports, name)) { 42/******/ Object.defineProperty(exports, name, { 43/******/ configurable: false, 44/******/ enumerable: true, 45/******/ get: getter 46/******/ }); 47/******/ } 48/******/ }; 49/******/ 50/******/ // getDefaultExport function for compatibility with non-harmony modules 51/******/ __webpack_require__.n = function(module) { 52/******/ var getter = module && module.__esModule ? 53/******/ function getDefault() { return module['default']; } : 54/******/ function getModuleExports() { return module; }; 55/******/ __webpack_require__.d(getter, 'a', getter); 56/******/ return getter; 57/******/ }; 58/******/ 59/******/ // Object.prototype.hasOwnProperty.call 60/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61/******/ 62/******/ // __webpack_public_path__ 63/******/ __webpack_require__.p = ""; 64/******/ 65/******/ // Load entry module and return exports 66/******/ return __webpack_require__(__webpack_require__.s = 35); 67/******/ }) 68/************************************************************************/ 69/******/ ([ 70/* 0 */ 71/***/ (function(module, exports) { 72 73module.exports = jQuery; 74 75/***/ }), 76/* 1 */ 77/***/ (function(module, __webpack_exports__, __webpack_require__) { 78 79"use strict"; 80/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return rtl; }); 81/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GetYoDigits; }); 82/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transitionend; }); 83/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 84/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 85 86 87 88 89// Core Foundation Utilities, utilized in a number of places. 90 91/** 92 * Returns a boolean for RTL support 93 */ 94function rtl() { 95 return __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html').attr('dir') === 'rtl'; 96} 97 98/** 99 * returns a random base-36 uid with namespacing 100 * @function 101 * @param {Number} length - number of random base-36 digits desired. Increase for more random strings. 102 * @param {String} namespace - name of plugin to be incorporated in uid, optional. 103 * @default {String} '' - if no plugin name is provided, nothing is appended to the uid. 104 * @returns {String} - unique id 105 */ 106function GetYoDigits(length, namespace) { 107 length = length || 6; 108 return Math.round(Math.pow(36, length + 1) - Math.random() * Math.pow(36, length)).toString(36).slice(1) + (namespace ? '-' + namespace : ''); 109} 110 111function transitionend($elem) { 112 var transitions = { 113 'transition': 'transitionend', 114 'WebkitTransition': 'webkitTransitionEnd', 115 'MozTransition': 'transitionend', 116 'OTransition': 'otransitionend' 117 }; 118 var elem = document.createElement('div'), 119 end; 120 121 for (var t in transitions) { 122 if (typeof elem.style[t] !== 'undefined') { 123 end = transitions[t]; 124 } 125 } 126 if (end) { 127 return end; 128 } else { 129 end = setTimeout(function () { 130 $elem.triggerHandler('transitionend', [$elem]); 131 }, 1); 132 return 'transitionend'; 133 } 134} 135 136 137 138/***/ }), 139/* 2 */ 140/***/ (function(module, __webpack_exports__, __webpack_require__) { 141 142"use strict"; 143/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Plugin; }); 144/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 145/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 146/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 147 148 149var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 150 151function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 152 153 154 155 156// Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST 157// {function} _setup (replaces previous constructor), 158// {function} _destroy (replaces previous destroy) 159 160var Plugin = function () { 161 function Plugin(element, options) { 162 _classCallCheck(this, Plugin); 163 164 this._setup(element, options); 165 var pluginName = getPluginName(this); 166 this.uuid = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["a" /* GetYoDigits */])(6, pluginName); 167 168 if (!this.$element.attr('data-' + pluginName)) { 169 this.$element.attr('data-' + pluginName, this.uuid); 170 } 171 if (!this.$element.data('zfPlugin')) { 172 this.$element.data('zfPlugin', this); 173 } 174 /** 175 * Fires when the plugin has initialized. 176 * @event Plugin#init 177 */ 178 this.$element.trigger('init.zf.' + pluginName); 179 } 180 181 _createClass(Plugin, [{ 182 key: 'destroy', 183 value: function destroy() { 184 this._destroy(); 185 var pluginName = getPluginName(this); 186 this.$element.removeAttr('data-' + pluginName).removeData('zfPlugin') 187 /** 188 * Fires when the plugin has been destroyed. 189 * @event Plugin#destroyed 190 */ 191 .trigger('destroyed.zf.' + pluginName); 192 for (var prop in this) { 193 this[prop] = null; //clean up script to prep for garbage collection. 194 } 195 } 196 }]); 197 198 return Plugin; 199}(); 200 201// Convert PascalCase to kebab-case 202// Thank you: http://stackoverflow.com/a/8955580 203 204 205function hyphenate(str) { 206 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 207} 208 209function getPluginName(obj) { 210 if (typeof obj.constructor.name !== 'undefined') { 211 return hyphenate(obj.constructor.name); 212 } else { 213 return hyphenate(obj.className); 214 } 215} 216 217 218 219/***/ }), 220/* 3 */ 221/***/ (function(module, __webpack_exports__, __webpack_require__) { 222 223"use strict"; 224/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MediaQuery; }); 225/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 226/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 227 228 229 230 231// Default set of media queries 232var defaultQueries = { 233 'default': 'only screen', 234 landscape: 'only screen and (orientation: landscape)', 235 portrait: 'only screen and (orientation: portrait)', 236 retina: 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 'only screen and (min--moz-device-pixel-ratio: 2),' + 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 'only screen and (min-device-pixel-ratio: 2),' + 'only screen and (min-resolution: 192dpi),' + 'only screen and (min-resolution: 2dppx)' 237}; 238 239// matchMedia() polyfill - Test a CSS media type/query in JS. 240// Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license 241var matchMedia = window.matchMedia || function () { 242 'use strict'; 243 244 // For browsers that support matchMedium api such as IE 9 and webkit 245 246 var styleMedia = window.styleMedia || window.media; 247 248 // For those that don't support matchMedium 249 if (!styleMedia) { 250 var style = document.createElement('style'), 251 script = document.getElementsByTagName('script')[0], 252 info = null; 253 254 style.type = 'text/css'; 255 style.id = 'matchmediajs-test'; 256 257 script && script.parentNode && script.parentNode.insertBefore(style, script); 258 259 // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 260 info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle; 261 262 styleMedia = { 263 matchMedium: function (media) { 264 var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; 265 266 // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 267 if (style.styleSheet) { 268 style.styleSheet.cssText = text; 269 } else { 270 style.textContent = text; 271 } 272 273 // Test if media query is true or false 274 return info.width === '1px'; 275 } 276 }; 277 } 278 279 return function (media) { 280 return { 281 matches: styleMedia.matchMedium(media || 'all'), 282 media: media || 'all'
283 }; 284 }; 285}(); 286 287var MediaQuery = { 288 queries: [], 289 290 current: '', 291 292 /** 293 * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher. 294 * @function 295 * @private 296 */ 297 _init: function () { 298 var self = this; 299 var $meta = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('meta.foundation-mq'); 300 if (!$meta.length) { 301 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<meta class="foundation-mq">').appendTo(document.head); 302 } 303 304 var extractedStyles = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.foundation-mq').css('font-family'); 305 var namedQueries; 306 307 namedQueries = parseStyleToObject(extractedStyles); 308 309 for (var key in namedQueries) { 310 if (namedQueries.hasOwnProperty(key)) { 311 self.queries.push({ 312 name: key, 313 value: 'only screen and (min-width: ' + namedQueries[key] + ')' 314 }); 315 } 316 } 317 318 this.current = this._getCurrentSize(); 319 320 this._watcher(); 321 }, 322 323 324 /** 325 * Checks if the screen is at least as wide as a breakpoint. 326 * @function 327 * @param {String} size - Name of the breakpoint to check. 328 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller. 329 */ 330 atLeast: function (size) { 331 var query = this.get(size); 332 333 if (query) { 334 return matchMedia(query).matches; 335 } 336 337 return false; 338 }, 339 340 341 /** 342 * Checks if the screen matches to a breakpoint. 343 * @function 344 * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method. 345 * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not. 346 */ 347 is: function (size) { 348 size = size.trim().split(' '); 349 if (size.length > 1 && size[1] === 'only') { 350 if (size[0] === this._getCurrentSize()) return true; 351 } else { 352 return this.atLeast(size[0]); 353 } 354 return false; 355 }, 356 357 358 /** 359 * Gets the media query of a breakpoint. 360 * @function 361 * @param {String} size - Name of the breakpoint to get. 362 * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist. 363 */ 364 get: function (size) { 365 for (var i in this.queries) { 366 if (this.queries.hasOwnProperty(i)) { 367 var query = this.queries[i]; 368 if (size === query.name) return query.value; 369 } 370 } 371 372 return null; 373 }, 374 375 376 /** 377 * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one). 378 * @function 379 * @private 380 * @returns {String} Name of the current breakpoint. 381 */ 382 _getCurrentSize: function () { 383 var matched; 384 385 for (var i = 0; i < this.queries.length; i++) { 386 var query = this.queries[i]; 387 388 if (matchMedia(query.value).matches) { 389 matched = query; 390 } 391 } 392 393 if (typeof matched === 'object') { 394 return matched.name; 395 } else { 396 return matched; 397 } 398 }, 399 400 401 /** 402 * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes. 403 * @function 404 * @private 405 */ 406 _watcher: function () { 407 var _this = this; 408 409 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () { 410 var newSize = _this._getCurrentSize(), 411 currentSize = _this.current; 412 413 if (newSize !== currentSize) { 414 // Change the current media query 415 _this.current = newSize; 416 417 // Broadcast the media query change on the window 418 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]); 419 } 420 }); 421 } 422}; 423 424// Thank you: https://github.com/sindresorhus/query-string 425function parseStyleToObject(str) { 426 var styleObject = {}; 427 428 if (typeof str !== 'string') { 429 return styleObject; 430 } 431 432 str = str.trim().slice(1, -1); // browsers re-quote string style values 433 434 if (!str) { 435 return styleObject; 436 } 437 438 styleObject = str.split('&').reduce(function (ret, param) { 439 var parts = param.replace(/\+/g, ' ').split('='); 440 var key = parts[0]; 441 var val = parts[1]; 442 key = decodeURIComponent(key); 443 444 // missing `=` should be `null`: 445 // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 446 val = val === undefined ? null : decodeURIComponent(val); 447 448 if (!ret.hasOwnProperty(key)) { 449 ret[key] = val; 450 } else if (Array.isArray(ret[key])) { 451 ret[key].push(val); 452 } else { 453 ret[key] = [ret[key], val]; 454 } 455 return ret; 456 }, {}); 457 458 return styleObject; 459} 460 461 462 463/***/ }), 464/* 4 */ 465/***/ (function(module, __webpack_exports__, __webpack_require__) { 466 467"use strict"; 468/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Keyboard; }); 469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 470/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 471/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 472/******************************************* 473 * * 474 * This util was created by Marius Olbertz * 475 * Please thank Marius on GitHub /owlbertz * 476 * or the web http://www.mariusolbertz.de/ * 477 * * 478 ******************************************/ 479 480 481 482 483 484 485var keyCodes = { 486 9: 'TAB', 487 13: 'ENTER', 488 27: 'ESCAPE', 489 32: 'SPACE', 490 35: 'END', 491 36: 'HOME', 492 37: 'ARROW_LEFT', 493 38: 'ARROW_UP', 494 39: 'ARROW_RIGHT', 495 40: 'ARROW_DOWN' 496}; 497 498var commands = {}; 499 500// Functions pulled out to be referenceable from internals 501function findFocusable($element) { 502 if (!$element) { 503 return false; 504 }
vendor: 4,436 bytes, lines 505-619
505 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 () { 506 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':visible') || __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('tabindex') < 0) { 507 return false; 508 } //only have visible elements and those that have a tabindex greater or equal 0 509 return true; 510 }); 511} 512 513function parseKey(event) { 514 var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase(); 515 516 // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events 517 key = key.replace(/\W+/, ''); 518 519 if (event.shiftKey) key = 'SHIFT_' + key; 520 if (event.ctrlKey) key = 'CTRL_' + key; 521 if (event.altKey) key = 'ALT_' + key; 522 523 // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`) 524 key = key.replace(/_$/, ''); 525 526 return key; 527} 528 529var Keyboard = { 530 keys: getKeyCodes(keyCodes), 531 532 /** 533 * Parses the (keyboard) event and returns a String that represents its key 534 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 535 * @param {Event} event - the event generated by the event handler 536 * @return String key - String that represents the key pressed 537 */ 538 parseKey: parseKey, 539 540 /** 541 * Handles the given (keyboard) event 542 * @param {Event} event - the event generated by the event handler 543 * @param {String} component - Foundation component's name, e.g. Slider or Reveal 544 * @param {Objects} functions - collection of functions that are to be executed 545 */ 546 handleKey: function (event, component, functions) { 547 var commandList = commands[component], 548 keyCode = this.parseKey(event), 549 cmds, 550 command, 551 fn; 552 553 if (!commandList) return console.warn('Component not defined!'); 554 555 if (typeof commandList.ltr === 'undefined') { 556 // this component does not differentiate between ltr and rtl 557 cmds = commandList; // use plain list 558 } else { 559 // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa 560 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["b" /* rtl */])()) cmds = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, commandList.ltr, commandList.rtl);else cmds = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, commandList.rtl, commandList.ltr); 561 } 562 command = cmds[keyCode]; 563 564 fn = functions[command]; 565 if (fn && typeof fn === 'function') { 566 // execute function if exists 567 var returnValue = fn.apply(); 568 if (functions.handled || typeof functions.handled === 'function') { 569 // execute function when event was handled 570 functions.handled(returnValue); 571 } 572 } else { 573 if (functions.unhandled || typeof functions.unhandled === 'function') { 574 // execute function when event was not handled 575 functions.unhandled(); 576 } 577 } 578 }, 579 580 581 /** 582 * Finds all focusable elements within the given `$element` 583 * @param {jQuery} $element - jQuery object to search within 584 * @return {jQuery} $focusable - all focusable elements within `$element` 585 */ 586 587 findFocusable: findFocusable, 588 589 /** 590 * Returns the component name name 591 * @param {Object} component - Foundation component, e.g. Slider or Reveal 592 * @return String componentName 593 */ 594 595 register: function (componentName, cmds) { 596 commands[componentName] = cmds; 597 }, 598 599 600 // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context? 601 // 602 /** 603 * Traps the focus in the given element. 604 * @param {jQuery} $element jQuery object to trap the foucs into. 605 */ 606 trapFocus: function ($element) { 607 var $focusable = findFocusable($element), 608 $firstFocusable = $focusable.eq(0), 609 $lastFocusable = $focusable.eq(-1); 610 611 $element.on('keydown.zf.trapfocus', function (event) { 612 if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') { 613 event.preventDefault(); 614 $firstFocusable.focus(); 615 } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') { 616 event.preventDefault(); 617 $lastFocusable.focus(); 618 } 619 });
620 }, 621 622 /** 623 * Releases the trapped focus from the given element. 624 * @param {jQuery} $element jQuery object to release the focus for. 625 */ 626 releaseFocus: function ($element) { 627 $element.off('keydown.zf.trapfocus'); 628 } 629}; 630 631/* 632 * Constants for easier comparing. 633 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 634 */ 635function getKeyCodes(kcs) { 636 var k = {}; 637 for (var kc in kcs) { 638 k[kcs[kc]] = kcs[kc]; 639 }return k; 640} 641 642 643 644/***/ }), 645/* 5 */ 646/***/ (function(module, __webpack_exports__, __webpack_require__) { 647 648"use strict"; 649/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Triggers; }); 650/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 651/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 652/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__ = __webpack_require__(6); 653 654 655 656 657 658var MutationObserver = function () { 659 var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; 660 for (var i = 0; i < prefixes.length; i++) { 661 if (prefixes[i] + 'MutationObserver' in window) { 662 return window[prefixes[i] + 'MutationObserver']; 663 } 664 } 665 return false; 666}(); 667 668var triggers = function (el, type) { 669 el.data(type).split(' ').forEach(function (id) { 670 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id)[type === 'close' ? 'trigger' : 'triggerHandler'](type + '.zf.trigger', [el]); 671 }); 672}; 673 674var Triggers = { 675 Listeners: { 676 Basic: {}, 677 Global: {} 678 }, 679 Initializers: {} 680}; 681 682Triggers.Listeners.Basic = { 683 openListener: function () { 684 triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'open'); 685 }, 686 closeListener: function () { 687 var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('close'); 688 if (id) { 689 triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'close'); 690 } else { 691 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('close.zf.trigger'); 692 } 693 }, 694 toggleListener: function () { 695 var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle'); 696 if (id) { 697 triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'toggle'); 698 } else { 699 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('toggle.zf.trigger'); 700 } 701 }, 702 closeableListener: function (e) { 703 e.stopPropagation(); 704 var animation = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('closable'); 705 706 if (animation !== '') { 707 __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["a" /* Motion */].animateOut(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), animation, function () { 708 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('closed.zf'); 709 }); 710 } else { 711 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).fadeOut().trigger('closed.zf'); 712 } 713 }, 714 toggleFocusListener: function () { 715 var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle-focus'); 716 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id).triggerHandler('toggle.zf.trigger', [__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)]); 717 } 718}; 719 720// Elements with [data-open] will reveal a plugin that supports it when clicked. 721Triggers.Initializers.addOpenListener = function ($elem) { 722 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener); 723 $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener); 724}; 725 726// Elements with [data-close] will close a plugin that supports it when clicked. 727// If used without a value on [data-close], the event will bubble, allowing it to close a parent component. 728Triggers.Initializers.addCloseListener = function ($elem) { 729 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener); 730 $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener); 731}; 732 733// Elements with [data-toggle] will toggle a plugin that supports it when clicked.
vendor: 5,966 bytes, lines 734-878
734Triggers.Initializers.addToggleListener = function ($elem) { 735 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener); 736 $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener); 737}; 738 739// Elements with [data-closable] will respond to close.zf.trigger events. 740Triggers.Initializers.addCloseableListener = function ($elem) { 741 $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener); 742 $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener); 743}; 744 745// Elements with [data-toggle-focus] will respond to coming in and out of focus 746Triggers.Initializers.addToggleFocusListener = function ($elem) { 747 $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener); 748 $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener); 749}; 750 751// More Global/complex listeners and triggers 752Triggers.Listeners.Global = { 753 resizeListener: function ($nodes) { 754 if (!MutationObserver) { 755 //fallback for IE 9 756 $nodes.each(function () { 757 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('resizeme.zf.trigger'); 758 }); 759 } 760 //trigger all listening elements and signal a resize event 761 $nodes.attr('data-events', "resize"); 762 }, 763 scrollListener: function ($nodes) { 764 if (!MutationObserver) { 765 //fallback for IE 9 766 $nodes.each(function () { 767 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('scrollme.zf.trigger'); 768 }); 769 } 770 //trigger all listening elements and signal a scroll event 771 $nodes.attr('data-events', "scroll"); 772 }, 773 closeMeListener: function (e, pluginId) { 774 var plugin = e.namespace.split('.')[0]; 775 var plugins = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + plugin + ']').not('[data-yeti-box="' + pluginId + '"]'); 776 777 plugins.each(function () { 778 var _this = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this); 779 _this.triggerHandler('close.zf.trigger', [_this]); 780 }); 781 } 782}; 783 784// Global, parses whole document. 785Triggers.Initializers.addClosemeListener = function (pluginName) { 786 var yetiBoxes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-yeti-box]'), 787 plugNames = ['dropdown', 'tooltip', 'reveal']; 788 789 if (pluginName) { 790 if (typeof pluginName === 'string') { 791 plugNames.push(pluginName); 792 } else if (typeof pluginName === 'object' && typeof pluginName[0] === 'string') { 793 plugNames.concat(pluginName); 794 } else { 795 console.error('Plugin names must be strings'); 796 } 797 } 798 if (yetiBoxes.length) { 799 var listeners = plugNames.map(function (name) { 800 return 'closeme.zf.' + name; 801 }).join(' '); 802 803 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener); 804 } 805}; 806 807function debounceGlobalListener(debounce, trigger, listener) { 808 var timer = void 0, 809 args = Array.prototype.slice.call(arguments, 3); 810 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(trigger).on(trigger, function (e) { 811 if (timer) { 812 clearTimeout(timer); 813 } 814 timer = setTimeout(function () { 815 listener.apply(null, args); 816 }, debounce || 10); //default time to emit scroll event 817 }); 818} 819 820Triggers.Initializers.addResizeListener = function (debounce) { 821 var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-resize]'); 822 if ($nodes.length) { 823 debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes); 824 } 825}; 826 827Triggers.Initializers.addScrollListener = function (debounce) { 828 var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-scroll]'); 829 if ($nodes.length) { 830 debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes); 831 } 832}; 833 834Triggers.Initializers.addMutationEventsListener = function ($elem) { 835 if (!MutationObserver) { 836 return false; 837 } 838 var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); 839 840 //element callback 841 var listeningElementsMutation = function (mutationRecordsList) { 842 var $target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(mutationRecordsList[0].target); 843 844 //trigger the event handler for the element depending on type 845 switch (mutationRecordsList[0].type) { 846 case "attributes": 847 if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") { 848 $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]); 849 } 850 if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") { 851 $target.triggerHandler('resizeme.zf.trigger', [$target]); 852 } 853 if (mutationRecordsList[0].attributeName === "style") { 854 $target.closest("[data-mutate]").attr("data-events", "mutate"); 855 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 856 } 857 break; 858 859 case "childList": 860 $target.closest("[data-mutate]").attr("data-events", "mutate"); 861 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 862 break; 863 864 default: 865 return false; 866 //nothing 867 } 868 }; 869 870 if ($nodes.length) { 871 //for each element that needs to listen for resizing, scrolling, or mutation add a single observer 872 for (var i = 0; i <= $nodes.length - 1; i++) { 873 var elementObserver = new MutationObserver(listeningElementsMutation); 874 elementObserver.observe($nodes[i], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: ["data-events", "style"] }); 875 } 876 } 877}; 878
879Triggers.Initializers.addSimpleListeners = function () { 880 var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document); 881 882 Triggers.Initializers.addOpenListener($document); 883 Triggers.Initializers.addCloseListener($document); 884 Triggers.Initializers.addToggleListener($document); 885 Triggers.Initializers.addCloseableListener($document); 886 Triggers.Initializers.addToggleFocusListener($document); 887}; 888 889Triggers.Initializers.addGlobalListeners = function () { 890 var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document); 891 Triggers.Initializers.addMutationEventsListener($document); 892 Triggers.Initializers.addResizeListener(); 893 Triggers.Initializers.addScrollListener(); 894 Triggers.Initializers.addClosemeListener(); 895}; 896 897Triggers.init = function ($, Foundation) { 898 if (typeof $.triggersInitialized === 'undefined') { 899 var $document = $(document); 900 901 if (document.readyState === "complete") { 902 Triggers.Initializers.addSimpleListeners(); 903 Triggers.Initializers.addGlobalListeners(); 904 } else { 905 $(window).on('load', function () { 906 Triggers.Initializers.addSimpleListeners(); 907 Triggers.Initializers.addGlobalListeners(); 908 }); 909 } 910 911 $.triggersInitialized = true; 912 } 913 914 if (Foundation) { 915 Foundation.Triggers = Triggers; 916 // Legacy included to be backwards compatible for now. 917 Foundation.IHearYou = Triggers.Initializers.addGlobalListeners; 918 } 919}; 920 921 922 923/***/ }), 924/* 6 */ 925/***/ (function(module, __webpack_exports__, __webpack_require__) { 926 927"use strict"; 928/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Move; }); 929/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Motion; }); 930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 931/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 932/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 933 934 935 936 937 938/** 939 * Motion module. 940 * @module foundation.motion 941 */ 942 943var initClasses = ['mui-enter', 'mui-leave']; 944var activeClasses = ['mui-enter-active', 'mui-leave-active']; 945 946var Motion = { 947 animateIn: function (element, animation, cb) { 948 animate(true, element, animation, cb); 949 }, 950 951 animateOut: function (element, animation, cb) { 952 animate(false, element, animation, cb); 953 } 954}; 955 956function Move(duration, elem, fn) { 957 var anim, 958 prog, 959 start = null; 960 // console.log('called'); 961 962 if (duration === 0) { 963 fn.apply(elem); 964 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 965 return; 966 } 967 968 function move(ts) { 969 if (!start) start = ts; 970 // console.log(start, ts); 971 prog = ts - start; 972 fn.apply(elem); 973 974 if (prog < duration) { 975 anim = window.requestAnimationFrame(move, elem); 976 } else { 977 window.cancelAnimationFrame(anim); 978 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 979 } 980 } 981 anim = window.requestAnimationFrame(move); 982} 983 984/** 985 * Animates an element in or out using a CSS transition class. 986 * @function 987 * @private 988 * @param {Boolean} isIn - Defines if the animation is in or out. 989 * @param {Object} element - jQuery or HTML object to animate. 990 * @param {String} animation - CSS class to use. 991 * @param {Function} cb - Callback to run when animation is finished. 992 */ 993function animate(isIn, element, animation, cb) { 994 element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element).eq(0); 995 996 if (!element.length) return; 997 998 var initClass = isIn ? initClasses[0] : initClasses[1]; 999 var activeClass = isIn ? activeClasses[0] : activeClasses[1]; 1000 1001 // Set up the animation 1002 reset(); 1003 1004 element.addClass(animation).css('transition', 'none'); 1005 1006 requestAnimationFrame(function () { 1007 element.addClass(initClass); 1008 if (isIn) element.show(); 1009 }); 1010 1011 // Start the animation 1012 requestAnimationFrame(function () { 1013 element[0].offsetWidth; 1014 element.css('transition', '').addClass(activeClass); 1015 }); 1016 1017 // Clean up the animation when it finishes 1018 element.one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["c" /* transitionend */])(element), finish); 1019 1020 // Hides the element (for out animations), resets the element, and runs a callback 1021 function finish() { 1022 if (!isIn) element.hide(); 1023 reset(); 1024 if (cb) cb.apply(element); 1025 } 1026 1027 // Resets transitions and removes motion-specific classes 1028 function reset() { 1029 element[0].style.transitionDuration = 0; 1030 element.removeClass(initClass + ' ' + activeClass + ' ' + animation); 1031 } 1032} 1033 1034 1035 1036/***/ }), 1037/* 7 */ 1038/***/ (function(module, __webpack_exports__, __webpack_require__) { 1039 1040"use strict"; 1041/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Box; }); 1042/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_util_core__ = __webpack_require__(1); 1043 1044 1045 1046 1047var Box = { 1048 ImNotTouchingYou: ImNotTouchingYou, 1049 OverlapArea: OverlapArea, 1050 GetDimensions: GetDimensions, 1051 GetOffsets: GetOffsets, 1052 GetExplicitOffsets: GetExplicitOffsets 1053}; 1054 1055/** 1056 * Compares the dimensions of an element to a container and determines collision events with container. 1057 * @function 1058 * @param {jQuery} element - jQuery object to test for collisions. 1059 * @param {jQuery}
vendor: 4,238 bytes, lines 1059-1164
1059 parent - jQuery object to use as bounding container. 1060 * @param {Boolean} lrOnly - set to true to check left and right values only. 1061 * @param {Boolean} tbOnly - set to true to check top and bottom values only. 1062 * @default if no parent object passed, detects collisions with `window`. 1063 * @returns {Boolean} - true if collision free, false if a collision in any direction. 1064 */ 1065function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) { 1066 return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0; 1067}; 1068 1069function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) { 1070 var eleDims = GetDimensions(element), 1071 topOver, 1072 bottomOver, 1073 leftOver, 1074 rightOver; 1075 if (parent) { 1076 var parDims = GetDimensions(parent); 1077 1078 bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height); 1079 topOver = eleDims.offset.top - parDims.offset.top; 1080 leftOver = eleDims.offset.left - parDims.offset.left; 1081 rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width); 1082 } else { 1083 bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height); 1084 topOver = eleDims.offset.top - eleDims.windowDims.offset.top; 1085 leftOver = eleDims.offset.left - eleDims.windowDims.offset.left; 1086 rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width); 1087 } 1088 1089 bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0); 1090 topOver = Math.min(topOver, 0); 1091 leftOver = Math.min(leftOver, 0); 1092 rightOver = Math.min(rightOver, 0); 1093 1094 if (lrOnly) { 1095 return leftOver + rightOver; 1096 } 1097 if (tbOnly) { 1098 return topOver + bottomOver; 1099 } 1100 1101 // use sum of squares b/c we care about overlap area. 1102 return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver); 1103} 1104 1105/** 1106 * Uses native methods to return an object of dimension values. 1107 * @function 1108 * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window. 1109 * @returns {Object} - nested object of integer pixel values 1110 * TODO - if element is window, return only those values. 1111 */ 1112function GetDimensions(elem) { 1113 elem = elem.length ? elem[0] : elem; 1114 1115 if (elem === window || elem === document) { 1116 throw new Error("I'm sorry, Dave. I'm afraid I can't do that."); 1117 } 1118 1119 var rect = elem.getBoundingClientRect(), 1120 parRect = elem.parentNode.getBoundingClientRect(), 1121 winRect = document.body.getBoundingClientRect(), 1122 winY = window.pageYOffset, 1123 winX = window.pageXOffset; 1124 1125 return { 1126 width: rect.width, 1127 height: rect.height, 1128 offset: { 1129 top: rect.top + winY, 1130 left: rect.left + winX 1131 }, 1132 parentDims: { 1133 width: parRect.width, 1134 height: parRect.height, 1135 offset: { 1136 top: parRect.top + winY, 1137 left: parRect.left + winX 1138 } 1139 }, 1140 windowDims: { 1141 width: winRect.width, 1142 height: winRect.height, 1143 offset: { 1144 top: winY, 1145 left: winX 1146 } 1147 } 1148 }; 1149} 1150 1151/** 1152 * Returns an object of top and left integer pixel values for dynamically rendered elements, 1153 * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where 1154 * you don't know alignment, but generally from 1155 * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment. 1156 * @function 1157 * @param {jQuery} element - jQuery object for the element being positioned. 1158 * @param {jQuery} anchor - jQuery object for the element's anchor point. 1159 * @param {String} position - a string relating to the desired position of the element, relative to it's anchor 1160 * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element. 1161 * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element. 1162 * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset. 1163 * TODO alter/rewrite to work with `em` values as well/instead of pixels 1164 */
1165function GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) { 1166 console.log("NOTE: GetOffsets is deprecated in favor of GetExplicitOffsets and will be removed in 6.5"); 1167 switch (position) { 1168 case 'top': 1169 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__foundation_util_core__["b" /* rtl */])() ? GetExplicitOffsets(element, anchor, 'top', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'top', 'right', vOffset, hOffset, isOverflow); 1170 case 'bottom': 1171 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__foundation_util_core__["b" /* rtl */])() ? GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow); 1172 case 'center top': 1173 return GetExplicitOffsets(element, anchor, 'top', 'center', vOffset, hOffset, isOverflow); 1174 case 'center bottom': 1175 return GetExplicitOffsets(element, anchor, 'bottom', 'center', vOffset, hOffset, isOverflow); 1176 case 'center left': 1177 return GetExplicitOffsets(element, anchor, 'left', 'center', vOffset, hOffset, isOverflow); 1178 case 'center right': 1179 return GetExplicitOffsets(element, anchor, 'right', 'center', vOffset, hOffset, isOverflow); 1180 case 'left bottom': 1181 return GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow); 1182 case 'right bottom': 1183 return GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow); 1184 // Backwards compatibility... this along with the reveal and reveal full 1185 // classes are the only ones that didn't reference anchor 1186 case 'center': 1187 return { 1188 left: $eleDims.windowDims.offset.left + $eleDims.windowDims.width / 2 - $eleDims.width / 2 + hOffset, 1189 top: $eleDims.windowDims.offset.top + $eleDims.windowDims.height / 2 - ($eleDims.height / 2 + vOffset) 1190 }; 1191 case 'reveal': 1192 return { 1193 left: ($eleDims.windowDims.width - $eleDims.width) / 2 + hOffset, 1194 top: $eleDims.windowDims.offset.top + vOffset 1195 }; 1196 case 'reveal full': 1197 return { 1198 left: $eleDims.windowDims.offset.left, 1199 top: $eleDims.windowDims.offset.top 1200 }; 1201 break; 1202 default: 1203 return { 1204 left: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__foundation_util_core__["b" /* rtl */])() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset : $anchorDims.offset.left + hOffset, 1205 top: $anchorDims.offset.top + $anchorDims.height + vOffset 1206 }; 1207 1208 } 1209} 1210 1211function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) { 1212 var $eleDims = GetDimensions(element), 1213 $anchorDims = anchor ? GetDimensions(anchor) : null; 1214 1215 var topVal, leftVal; 1216 1217 // set position related attribute 1218 1219 switch (position) { 1220 case 'top': 1221 topVal = $anchorDims.offset.top - ($eleDims.height + vOffset); 1222 break; 1223 case 'bottom': 1224 topVal = $anchorDims.offset.top + $anchorDims.height + vOffset; 1225 break; 1226 case 'left': 1227 leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset); 1228 break; 1229 case 'right': 1230 leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset; 1231 break; 1232 } 1233 1234 // set alignment related attribute 1235 switch (position) { 1236 case 'top': 1237 case 'bottom': 1238 switch (alignment) { 1239 case 'left': 1240 leftVal = $anchorDims.offset.left + hOffset; 1241 break; 1242 case 'right': 1243 leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset; 1244 break; 1245 case 'center': 1246 leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset; 1247 break; 1248 } 1249 break; 1250 case 'right': 1251 case 'left': 1252 switch (alignment) { 1253 case 'bottom': 1254 topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height; 1255 break; 1256 case 'top': 1257 topVal = $anchorDims.offset.top + vOffset; 1258 break; 1259 case 'center': 1260 topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2; 1261 break; 1262 } 1263 break; 1264 } 1265 return { top: topVal, left: leftVal }; 1266} 1267 1268 1269 1270/***/ }), 1271/* 8 */ 1272/***/ (function(module, __webpack_exports__, __webpack_require__) { 1273 1274"use strict"; 1275/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return onImagesLoaded; }); 1276/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 1277/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 1278 1279 1280 1281 1282/** 1283 * Runs a callback function when images are fully loaded. 1284 * @param {Object} images - Image(s) to check if loaded. 1285 * @param {Func} callback - Function to execute when image is fully loaded. 1286 */ 1287function onImagesLoaded(images, callback) { 1288 var self = this, 1289 unloaded = images.length; 1290 1291 if (unloaded === 0) { 1292 callback(); 1293 } 1294 1295 images.each(function () { 1296 // Check if image is loaded
1297 if (this.complete && this.naturalWidth !== undefined) { 1298 singleImageLoaded(); 1299 } else { 1300 // If the above check failed, simulate loading on detached element. 1301 var image = new Image(); 1302 // Still count image as loaded if it finalizes with an error. 1303 var events = "load.zf.images error.zf.images"; 1304 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(image).one(events, function me(event) { 1305 // Unbind the event listeners. We're using 'one' but only one of the two events will have fired. 1306 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).off(events, me); 1307 singleImageLoaded(); 1308 }); 1309 image.src = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('src'); 1310 } 1311 }); 1312 1313 function singleImageLoaded() { 1314 unloaded--; 1315 if (unloaded === 0) { 1316 callback(); 1317 } 1318 } 1319} 1320 1321 1322 1323/***/ }), 1324/* 9 */ 1325/***/ (function(module, __webpack_exports__, __webpack_require__) { 1326 1327"use strict"; 1328/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Nest; }); 1329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 1330/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 1331 1332 1333 1334 1335var Nest = { 1336 Feather: function (menu) { 1337 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf'; 1338 1339 menu.attr('role', 'menubar'); 1340 1341 var items = menu.find('li').attr({ 'role': 'menuitem' }), 1342 subMenuClass = 'is-' + type + '-submenu', 1343 subItemClass = subMenuClass + '-item', 1344 hasSubClass = 'is-' + type + '-submenu-parent', 1345 applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes. 1346 1347 items.each(function () { 1348 var $item = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 1349 $sub = $item.children('ul'); 1350 1351 if ($sub.length) { 1352 $item.addClass(hasSubClass); 1353 $sub.addClass('submenu ' + subMenuClass).attr({ 'data-submenu': '' }); 1354 if (applyAria) { 1355 $item.attr({ 1356 'aria-haspopup': true, 1357 'aria-label': $item.children('a:first').text() 1358 }); 1359 // Note: Drilldowns behave differently in how they hide, and so need 1360 // additional attributes. We should look if this possibly over-generalized 1361 // utility (Nest) is appropriate when we rework menus in 6.4 1362 if (type === 'drilldown') { 1363 $item.attr({ 'aria-expanded': false }); 1364 } 1365 } 1366 $sub.addClass('submenu ' + subMenuClass).attr({ 1367 'data-submenu': '', 1368 'role': 'menu' 1369 }); 1370 if (type === 'drilldown') { 1371 $sub.attr({ 'aria-hidden': true }); 1372 } 1373 } 1374 1375 if ($item.parent('[data-submenu]').length) { 1376 $item.addClass('is-submenu-item ' + subItemClass); 1377 } 1378 }); 1379 1380 return; 1381 }, 1382 Burn: function (menu, type) { 1383 var //items = menu.find('li'), 1384 subMenuClass = 'is-' + type + '-submenu', 1385 subItemClass = subMenuClass + '-item', 1386 hasSubClass = 'is-' + type + '-submenu-parent'; 1387 1388 menu.find('>li, .menu, .menu > li').removeClass(subMenuClass + ' ' + subItemClass + ' ' + hasSubClass + ' is-submenu-item submenu is-active').removeAttr('data-submenu').css('display', ''); 1389 } 1390}; 1391 1392 1393 1394/***/ }), 1395/* 10 */ 1396/***/ (function(module, __webpack_exports__, __webpack_require__) { 1397 1398"use strict"; 1399/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Accordion; }); 1400/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 1401/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 1402/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 1403/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(1); 1404/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2); 1405 1406 1407var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 1408 1409function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1410 1411function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 1412 1413function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
1413onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 1414 1415 1416 1417 1418 1419 1420/** 1421 * Accordion module. 1422 * @module foundation.accordion 1423 * @requires foundation.util.keyboard 1424 */ 1425 1426var Accordion = function (_Plugin) { 1427 _inherits(Accordion, _Plugin); 1428 1429 function Accordion() { 1430 _classCallCheck(this, Accordion); 1431 1432 return _possibleConstructorReturn(this, (Accordion.__proto__ || Object.getPrototypeOf(Accordion)).apply(this, arguments)); 1433 } 1434 1435 _createClass(Accordion, [{ 1436 key: '_setup', 1437 1438 /** 1439 * Creates a new instance of an accordion. 1440 * @class 1441 * @name Accordion 1442 * @fires Accordion#init 1443 * @param {jQuery} element - jQuery object to make into an accordion. 1444 * @param {Object} options - a plain object with settings to override the default options. 1445 */ 1446 value: function _setup(element, options) { 1447 this.$element = element; 1448 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Accordion.defaults, this.$element.data(), options); 1449 1450 this.className = 'Accordion'; // ie9 back compat 1451 this._init(); 1452 1453 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Accordion', { 1454 'ENTER': 'toggle', 1455 'SPACE': 'toggle', 1456 'ARROW_DOWN': 'next', 1457 'ARROW_UP': 'previous' 1458 }); 1459 } 1460 1461 /** 1462 * Initializes the accordion by animating the preset active pane(s). 1463 * @private 1464 */ 1465 1466 }, { 1467 key: '_init', 1468 value: function _init() { 1469 var _this3 = this; 1470 1471 this.$element.attr('role', 'tablist'); 1472 this.$tabs = this.$element.children('[data-accordion-item]'); 1473 1474 this.$tabs.each(function (idx, el) { 1475 var $el = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el), 1476 $content = $el.children('[data-tab-content]'), 1477 id = $content[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["a" /* GetYoDigits */])(6, 'accordion'), 1478 linkId = el.id || id + '-label'; 1479 1480 $el.find('a:first').attr({ 1481 'aria-controls': id, 1482 'role': 'tab', 1483 'id': linkId, 1484 'aria-expanded': false, 1485 'aria-selected': false 1486 }); 1487 1488 $content.attr({ 'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id }); 1489 }); 1490 var $initActive = this.$element.find('.is-active').children('[data-tab-content]'); 1491 this.firstTimeInit = true; 1492 if ($initActive.length) { 1493 this.down($initActive, this.firstTimeInit); 1494 this.firstTimeInit = false; 1495 } 1496 1497 this._checkDeepLink = function () { 1498 var anchor = window.location.hash; 1499 //need a hash and a relevant anchor in this tabset 1500 if (anchor.length) { 1501 var $link = _this3.$element.find('[href$="' + anchor + '"]'), 1502 $anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor); 1503 1504 if ($link.length && $anchor) { 1505 if (!$link.parent('[data-accordion-item]').hasClass('is-active')) { 1506 _this3.down($anchor, _this3.firstTimeInit); 1507 _this3.firstTimeInit = false; 1508 }; 1509 1510 //roll up a little to show the titles 1511 if (_this3.options.deepLinkSmudge) { 1512 var _this = _this3; 1513 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).load(function () { 1514 var offset = _this.$element.offset(); 1515 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay); 1516 }); 1517 } 1518 1519 /** 1520 * Fires when the zplugin has deeplinked at pageload 1521 * @event Accordion#deeplink 1522 */ 1523 _this3.$element.trigger('deeplink.zf.accordion', [$link, $anchor]); 1524 } 1525 } 1526 }; 1527 1528 //use browser to open a tab, if it exists in this tabset 1529 if (this.options.deepLink) { 1530 this._checkDeepLink(); 1531 } 1532 1533 this._events(); 1534 } 1535 1536 /** 1537 * Adds event handlers for items within the accordion. 1538 * @private 1539 */ 1540 1541 }, { 1542 key: '_events', 1543 value: function _events() { 1544 var _this = this; 1545 1546 this.$tabs.each(function () { 1547 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this); 1548 var $tabContent = $elem.children('[data-tab-content]'); 1549 if ($tabContent.length) { 1550 $elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) { 1551 e.preventDefault(); 1552 _this.toggle($tabContent); 1553 }).on('keydown.zf.accordion', function (e) { 1554 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Accordion', { 1555 toggle: function () { 1556 _this.toggle($tabContent); 1557 }, 1558 next: function () { 1559 var $a = $elem.next().find('a').focus(); 1560 if (!_this.options.multiExpand) { 1561 $a.trigger('click.zf.accordion'); 1562 } 1563 }, 1564 previous: function () { 1565 var $a = $elem.prev().find('a').focus(); 1566 if (!_this.options.multiExpand) { 1567 $a.trigger('click.zf.accordion'); 1568 } 1569 }, 1570 handled: function () { 1571 e.preventDefault(); 1572 e.stopPropagation(); 1573 } 1574 }); 1575 }); 1576 } 1577 }); 1578 if (this.options.deepLink) { 1579 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._checkDeepLink); 1580 } 1581 } 1582 1583 /** 1584 * Toggles the selected content pane's open/close state. 1585 * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`). 1586 * @function 1587 */ 1588 1589 }, { 1590 key: 'toggle', 1591 value: function toggle($target) { 1592 if ($target.closest('[data-accordion]').is('[disabled]')) { 1593 console.info('Cannot toggle an accordion that is disabled.'); 1594 return; 1595 } 1596 if ($target.parent().hasClass('is-active')) { 1597 this.up($target); 1598 } else { 1599 this.down($target); 1600 } 1601 //either replace or update browser history 1602 if (this.options.deepLink) { 1603 var anchor = $target.prev('a').attr('href'); 1604 1605 if (this.options.updateHistory) { 1606 history.pushState({}, '', anchor); 1607 } else { 1608 history.replaceState({}, '', anchor); 1609 } 1610 } 1611 } 1612 1613 /** 1614 * Opens the accordion tab defined by `$target`. 1615 * @param {jQuery} $target - Accordion pane to open (`.accordion-content`). 1616 * @param {Boolean} firstTime - flag to determine if reflow should happen. 1617 * @fires Accordion#down 1618 * @function 1619 */ 1620 1621 }, { 1622 key: 'down', 1623 value: function down($target, firstTime) { 1624 var _this4 = this; 1625 1626 /** 1627 * checking firstTime allows for initial render of the accordion 1628 * to render preset is-active panes. 1629 */ 1630 if ($target.closest('[data-accordion]').is('[disabled]') && !firstTime) { 1631 console.info('Cannot call down on an accordion that is disabled.'); 1632 return; 1633 } 1634 $target.attr('aria-hidden', false).parent('[data-tab-content]').addBack().parent().addClass('is-active'); 1635 1636 if (!this.options.multiExpand && !firstTime) { 1637 var $currentActive = this.$element.children('.is-active').children('[data-tab-content]'); 1638 if ($currentActive.length) { 1639 this.up($currentActive.not($target)); 1640 } 1641 } 1642 1643 $target.slideDown(this.options.slideSpeed, function () { 1644 /** 1645 * Fires when the tab is done opening. 1646 * @event Accordion#down 1647 */ 1648 _this4.$element.trigger('down.zf.accordion', [$target]); 1649 }); 1650 1651 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target.attr('aria-labelledby')).attr({ 1652 'aria-expanded': true, 1653 'aria-selected': true 1654 }); 1655 } 1656 1657 /** 1658 * Closes the tab defined by `$target`. 1659 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1660 * @fires Accordion#up 1661 * @function 1662 */ 1663 1664 }, { 1665 key: 'up', 1666 value: function up($target) { 1667 if ($target.closest('[data-accordion]').is('[disabled]')) { 1668 console.info('Cannot call up on an accordion that is disabled.'); 1669 return; 1670 } 1671 1672 var $aunts = $target.parent().siblings(), 1673 _this = this; 1674 1675 if (!this.options.allowAllClosed && !$aunts.hasClass('is-active') || !$target.parent().hasClass('is-active')) { 1676 return; 1677 } 1678 1679 $target.slideUp(_this.options.slideSpeed, function () { 1680 /** 1681 * Fires when the tab is done collapsing up. 1682 * @event Accordion#up 1683 */ 1684 _this.$element.trigger('up.zf.accordion', [$target]); 1685 }); 1686 1687 $target.attr('aria-hidden', true).parent().removeClass('is-active'); 1688 1689 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target.attr('aria-labelledby')).attr({ 1690 'aria-expanded': false, 1691 'aria-selected': false 1692 }); 1693 } 1694 1695 /** 1696 * Destroys an instance of an accordion. 1697 * @fires Accordion#destroyed 1698 * @function 1699 */ 1700 1701 }, { 1702 key: '_destroy', 1703 value: function _destroy() {
1704 this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', ''); 1705 this.$element.find('a').off('.zf.accordion'); 1706 if (this.options.deepLink) { 1707 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink); 1708 } 1709 } 1710 }]); 1711 1712 return Accordion; 1713}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */]); 1714 1715Accordion.defaults = { 1716 /** 1717 * Amount of time to animate the opening of an accordion pane. 1718 * @option 1719 * @type {number} 1720 * @default 250 1721 */ 1722 slideSpeed: 250, 1723 /** 1724 * Allow the accordion to have multiple open panes. 1725 * @option 1726 * @type {boolean} 1727 * @default false 1728 */ 1729 multiExpand: false, 1730 /** 1731 * Allow the accordion to close all panes. 1732 * @option 1733 * @type {boolean} 1734 * @default false 1735 */ 1736 allowAllClosed: false, 1737 /** 1738 * Allows the window to scroll to content of pane specified by hash anchor 1739 * @option 1740 * @type {boolean} 1741 * @default false 1742 */ 1743 deepLink: false, 1744 1745 /** 1746 * Adjust the deep link scroll to make sure the top of the accordion panel is visible 1747 * @option 1748 * @type {boolean} 1749 * @default false 1750 */ 1751 deepLinkSmudge: false, 1752 1753 /** 1754 * Animation time (ms) for the deep link adjustment 1755 * @option 1756 * @type {number} 1757 * @default 300 1758 */ 1759 deepLinkSmudgeDelay: 300, 1760 1761 /** 1762 * Update the browser history with the open accordion 1763 * @option 1764 * @type {boolean} 1765 * @default false 1766 */ 1767 updateHistory: false 1768}; 1769 1770 1771 1772/***/ }), 1773/* 11 */ 1774/***/ (function(module, __webpack_exports__, __webpack_require__) { 1775 1776"use strict"; 1777/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AccordionMenu; }); 1778/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 1779/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 1780/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 1781/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9); 1782/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(1); 1783/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2); 1784 1785 1786var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 1787 1788function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1789 1790function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 1791 1792function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 1793 1794 1795 1796 1797 1798 1799 1800/** 1801 * AccordionMenu module. 1802 * @module foundation.accordionMenu 1803 * @requires foundation.util.keyboard 1804 * @requires foundation.util.nest 1805 */ 1806 1807var AccordionMenu = function (_Plugin) { 1808 _inherits(AccordionMenu, _Plugin); 1809 1810 function AccordionMenu() { 1811 _classCallCheck(this, AccordionMenu); 1812 1813 return _possibleConstructorReturn(this, (AccordionMenu.__proto__ || Object.getPrototypeOf(AccordionMenu)).apply(this, arguments)); 1814 } 1815 1816 _createClass(AccordionMenu, [{ 1817 key: '_setup', 1818 1819 /** 1820 * Creates a new instance of an accordion menu. 1821 * @class 1822 * @name AccordionMenu 1823 * @fires AccordionMenu#init 1824 * @param {jQuery} element - jQuery object to make into an accordion menu. 1825 * @param {Object} options - Overrides to the default plugin settings. 1826 */ 1827 value: function _setup(element, options) { 1828 this.$element = element; 1829 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options); 1830 this.className = 'AccordionMenu'; // ie9 back compat 1831 1832 this._init(); 1833 1834 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('AccordionMenu', { 1835 'ENTER': 'toggle', 1836 'SPACE': 'toggle', 1837 'ARROW_RIGHT': 'open', 1838 'ARROW_UP': 'up', 1839 'ARROW_DOWN': 'down', 1840 'ARROW_LEFT': 'close', 1841 'ESCAPE': 'closeAll' 1842 }); 1843 } 1844 1845 /** 1846 * Initializes the accordion menu by hiding all nested menus. 1847 * @private 1848 */ 1849 1850 }, { 1851 key: '_init', 1852 value: function _init() { 1853 __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["a" /* Nest */].Feather(this.$element, 'accordion'); 1854 1855 var _this = this; 1856 1857 this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem'); 1858 this.$element.attr({ 1859 'role': 'tree',
vendor: 6,065 bytes, lines 1860-2011
1860 'aria-multiselectable': this.options.multiOpen 1861 }); 1862 1863 this.$menuLinks = this.$element.find('.is-accordion-submenu-parent'); 1864 this.$menuLinks.each(function () { 1865 var linkId = this.id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'acc-menu-link'), 1866 $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 1867 $sub = $elem.children('[data-submenu]'), 1868 subId = $sub[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'acc-menu'), 1869 isActive = $sub.hasClass('is-active'); 1870 1871 if (_this.options.submenuToggle) { 1872 $elem.addClass('has-submenu-toggle'); 1873 $elem.children('a').after('<button id="' + linkId + '" class="submenu-toggle" aria-controls="' + subId + '" aria-expanded="' + isActive + '" title="' + _this.options.submenuToggleText + '"><span class="submenu-toggle-text">' + _this.options.submenuToggleText + '</span></button>'); 1874 } else { 1875 $elem.attr({ 1876 'aria-controls': subId, 1877 'aria-expanded': isActive, 1878 'id': linkId 1879 }); 1880 } 1881 $sub.attr({ 1882 'aria-labelledby': linkId, 1883 'aria-hidden': !isActive, 1884 'role': 'group', 1885 'id': subId 1886 }); 1887 }); 1888 this.$element.find('li').attr({ 1889 'role': 'treeitem' 1890 }); 1891 var initPanes = this.$element.find('.is-active'); 1892 if (initPanes.length) { 1893 var _this = this; 1894 initPanes.each(function () { 1895 _this.down(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)); 1896 }); 1897 } 1898 this._events(); 1899 } 1900 1901 /** 1902 * Adds event handlers for items within the menu. 1903 * @private 1904 */ 1905 1906 }, { 1907 key: '_events', 1908 value: function _events() { 1909 var _this = this; 1910 1911 this.$element.find('li').each(function () { 1912 var $submenu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('[data-submenu]'); 1913 1914 if ($submenu.length) { 1915 if (_this.options.submenuToggle) { 1916 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1917 _this.toggle($submenu); 1918 }); 1919 } else { 1920 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1921 e.preventDefault(); 1922 _this.toggle($submenu); 1923 }); 1924 } 1925 } 1926 }).on('keydown.zf.accordionmenu', function (e) { 1927 var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 1928 $elements = $element.parent('ul').children('li'), 1929 $prevElement, 1930 $nextElement, 1931 $target = $element.children('[data-submenu]'); 1932 1933 $elements.each(function (i) { 1934 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) { 1935 $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first(); 1936 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first(); 1937 1938 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('[data-submenu]:visible').length) { 1939 // has open sub menu 1940 $nextElement = $element.find('li:first-child').find('a').first(); 1941 } 1942 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':first-child')) { 1943 // is first element of sub menu 1944 $prevElement = $element.parents('li').first().find('a').first(); 1945 } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { 1946 // if previous element has open sub menu 1947 $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first(); 1948 } 1949 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':last-child')) { 1950 // is last element of sub menu 1951 $nextElement = $element.parents('li').first().next('li').find('a').first(); 1952 } 1953 1954 return; 1955 } 1956 }); 1957 1958 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'AccordionMenu', { 1959 open: function () { 1960 if ($target.is(':hidden')) { 1961 _this.down($target); 1962 $target.find('li').first().find('a').first().focus(); 1963 } 1964 }, 1965 close: function () { 1966 if ($target.length && !$target.is(':hidden')) { 1967 // close active sub of this item 1968 _this.up($target); 1969 } else if ($element.parent('[data-submenu]').length) { 1970 // close currently open sub 1971 _this.up($element.parent('[data-submenu]')); 1972 $element.parents('li').first().find('a').first().focus(); 1973 } 1974 }, 1975 up: function () { 1976 $prevElement.focus(); 1977 return true; 1978 }, 1979 down: function () { 1980 $nextElement.focus(); 1981 return true; 1982 }, 1983 toggle: function () { 1984 if (_this.options.submenuToggle) { 1985 return false; 1986 } 1987 if ($element.children('[data-submenu]').length) { 1988 _this.toggle($element.children('[data-submenu]')); 1989 return true; 1990 } 1991 }, 1992 closeAll: function () { 1993 _this.hideAll(); 1994 }, 1995 handled: function (preventDefault) { 1996 if (preventDefault) { 1997 e.preventDefault(); 1998 } 1999 e.stopImmediatePropagation(); 2000 } 2001 }); 2002 }); //.attr('tabindex', 0); 2003 } 2004 2005 /** 2006 * Closes all panes of the menu. 2007 * @function 2008 */ 2009 2010 }, { 2011 key: 'hideAll',
vendor: 1,832 bytes, lines 2012-2079
2012 value: function hideAll() { 2013 this.up(this.$element.find('[data-submenu]')); 2014 } 2015 2016 /** 2017 * Opens all panes of the menu. 2018 * @function 2019 */ 2020 2021 }, { 2022 key: 'showAll', 2023 value: function showAll() { 2024 this.down(this.$element.find('[data-submenu]')); 2025 } 2026 2027 /** 2028 * Toggles the open/close state of a submenu. 2029 * @function 2030 * @param {jQuery} $target - the submenu to toggle 2031 */ 2032 2033 }, { 2034 key: 'toggle', 2035 value: function toggle($target) { 2036 if (!$target.is(':animated')) { 2037 if (!$target.is(':hidden')) { 2038 this.up($target); 2039 } else { 2040 this.down($target); 2041 } 2042 } 2043 } 2044 2045 /** 2046 * Opens the sub-menu defined by `$target`. 2047 * @param {jQuery} $target - Sub-menu to open. 2048 * @fires AccordionMenu#down 2049 */ 2050 2051 }, { 2052 key: 'down', 2053 value: function down($target) { 2054 var _this = this; 2055 2056 if (!this.options.multiOpen) { 2057 this.up(this.$element.find('.is-active').not($target.parentsUntil(this.$element).add($target))); 2058 } 2059 2060 $target.addClass('is-active').attr({ 'aria-hidden': false }); 2061 2062 if (this.options.submenuToggle) { 2063 $target.prev('.submenu-toggle').attr({ 'aria-expanded': true }); 2064 } else { 2065 $target.parent('.is-accordion-submenu-parent').attr({ 'aria-expanded': true }); 2066 } 2067 2068 $target.slideDown(_this.options.slideSpeed, function () { 2069 /** 2070 * Fires when the menu is done opening. 2071 * @event AccordionMenu#down 2072 */ 2073 _this.$element.trigger('down.zf.accordionMenu', [$target]); 2074 }); 2075 } 2076 2077 /** 2078 * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well. 2079 * @param {jQuery} $target - Sub-menu to close.
2080 * @fires AccordionMenu#up 2081 */ 2082 2083 }, { 2084 key: 'up', 2085 value: function up($target) { 2086 var _this = this; 2087 $target.slideUp(_this.options.slideSpeed, function () { 2088 /** 2089 * Fires when the menu is done collapsing up. 2090 * @event AccordionMenu#up 2091 */ 2092 _this.$element.trigger('up.zf.accordionMenu', [$target]); 2093 }); 2094 2095 var $menus = $target.find('[data-submenu]').slideUp(0).addBack().attr('aria-hidden', true); 2096 2097 if (this.options.submenuToggle) { 2098 $menus.prev('.submenu-toggle').attr('aria-expanded', false); 2099 } else { 2100 $menus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false); 2101 } 2102 } 2103 2104 /** 2105 * Destroys an instance of accordion menu. 2106 * @fires AccordionMenu#destroyed 2107 */ 2108 2109 }, { 2110 key: '_destroy', 2111 value: function _destroy() { 2112 this.$element.find('[data-submenu]').slideDown(0).css('display', ''); 2113 this.$element.find('a').off('click.zf.accordionMenu'); 2114 2115 if (this.options.submenuToggle) { 2116 this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle'); 2117 this.$element.find('.submenu-toggle').remove(); 2118 } 2119 2120 __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["a" /* Nest */].Burn(this.$element, 'accordion'); 2121 } 2122 }]); 2123 2124 return AccordionMenu; 2125}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["a" /* Plugin */]); 2126 2127AccordionMenu.defaults = { 2128 /** 2129 * Amount of time to animate the opening of a submenu in ms. 2130 * @option 2131 * @type {number} 2132 * @default 250 2133 */ 2134 slideSpeed: 250, 2135 /** 2136 * Adds a separate submenu toggle button. This allows the parent item to have a link. 2137 * @option 2138 * @example true 2139 */ 2140 submenuToggle: false, 2141 /** 2142 * The text used for the submenu toggle if enabled. This is used for screen readers only. 2143 * @option 2144 * @example true 2145 */ 2146 submenuToggleText: 'Toggle menu', 2147 /** 2148 * Allow the menu to have multiple open panes. 2149 * @option 2150 * @type {boolean} 2151 * @default true 2152 */ 2153 multiOpen: true 2154}; 2155 2156 2157 2158/***/ }), 2159/* 12 */ 2160/***/ (function(module, __webpack_exports__, __webpack_require__) { 2161 2162"use strict"; 2163/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Drilldown; }); 2164/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 2165/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 2166/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 2167/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9); 2168/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(1); 2169/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_box__ = __webpack_require__(7); 2170/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin__ = __webpack_require__(2); 2171 2172 2173var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 2174 2175function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2176 2177function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 2178 2179function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
vendor: 23,342 bytes, lines 2179-2789
2179onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 2180 2181 2182 2183 2184 2185 2186 2187 2188/** 2189 * Drilldown module. 2190 * @module foundation.drilldown 2191 * @requires foundation.util.keyboard 2192 * @requires foundation.util.nest 2193 * @requires foundation.util.box 2194 */ 2195 2196var Drilldown = function (_Plugin) { 2197 _inherits(Drilldown, _Plugin); 2198 2199 function Drilldown() { 2200 _classCallCheck(this, Drilldown); 2201 2202 return _possibleConstructorReturn(this, (Drilldown.__proto__ || Object.getPrototypeOf(Drilldown)).apply(this, arguments)); 2203 } 2204 2205 _createClass(Drilldown, [{ 2206 key: '_setup', 2207 2208 /** 2209 * Creates a new instance of a drilldown menu. 2210 * @class 2211 * @name Drilldown 2212 * @param {jQuery} element - jQuery object to make into an accordion menu. 2213 * @param {Object} options - Overrides to the default plugin settings. 2214 */ 2215 value: function _setup(element, options) { 2216 this.$element = element; 2217 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Drilldown.defaults, this.$element.data(), options); 2218 this.className = 'Drilldown'; // ie9 back compat 2219 2220 this._init(); 2221 2222 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Drilldown', { 2223 'ENTER': 'open', 2224 'SPACE': 'open', 2225 'ARROW_RIGHT': 'next', 2226 'ARROW_UP': 'up', 2227 'ARROW_DOWN': 'down', 2228 'ARROW_LEFT': 'previous', 2229 'ESCAPE': 'close', 2230 'TAB': 'down', 2231 'SHIFT_TAB': 'up' 2232 }); 2233 } 2234 2235 /** 2236 * Initializes the drilldown by creating jQuery collections of elements 2237 * @private 2238 */ 2239 2240 }, { 2241 key: '_init', 2242 value: function _init() { 2243 __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["a" /* Nest */].Feather(this.$element, 'drilldown'); 2244 2245 if (this.options.autoApplyClass) { 2246 this.$element.addClass('drilldown'); 2247 } 2248 2249 this.$element.attr({ 2250 'role': 'tree', 2251 'aria-multiselectable': false 2252 }); 2253 this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a'); 2254 this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group'); 2255 this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a'); 2256 this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'drilldown')); 2257 2258 this._prepareMenu(); 2259 this._registerEvents(); 2260 2261 this._keyboardEvents(); 2262 } 2263 2264 /** 2265 * prepares drilldown menu by setting attributes to links and elements 2266 * sets a min height to prevent content jumping 2267 * wraps the element if not already wrapped 2268 * @private 2269 * @function 2270 */ 2271 2272 }, { 2273 key: '_prepareMenu', 2274 value: function _prepareMenu() { 2275 var _this = this; 2276 // if(!this.options.holdOpen){ 2277 // this._menuLinkEvents(); 2278 // } 2279 this.$submenuAnchors.each(function () { 2280 var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this); 2281 var $sub = $link.parent(); 2282 if (_this.options.parentLink) { 2283 $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menuitem"></li>'); 2284 } 2285 $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0); 2286 $link.children('[data-submenu]').attr({ 2287 'aria-hidden': true, 2288 'tabindex': 0, 2289 'role': 'group' 2290 }); 2291 _this._events($link); 2292 }); 2293 this.$submenus.each(function () { 2294 var $menu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 2295 $back = $menu.find('.js-drilldown-back'); 2296 if (!$back.length) { 2297 switch (_this.options.backButtonPosition) { 2298 case "bottom": 2299 $menu.append(_this.options.backButton); 2300 break; 2301 case "top": 2302 $menu.prepend(_this.options.backButton); 2303 break; 2304 default: 2305 console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'"); 2306 } 2307 } 2308 _this._back($menu); 2309 }); 2310 2311 this.$submenus.addClass('invisible'); 2312 if (!this.options.autoHeight) { 2313 this.$submenus.addClass('drilldown-submenu-cover-previous'); 2314 } 2315 2316 // create a wrapper on element if it doesn't exist. 2317 if (!this.$element.parent().hasClass('is-drilldown')) { 2318 this.$wrapper = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.wrapper).addClass('is-drilldown'); 2319 if (this.options.animateHeight) this.$wrapper.addClass('animate-height'); 2320 this.$element.wrap(this.$wrapper); 2321 } 2322 // set wrapper 2323 this.$wrapper = this.$element.parent(); 2324 this.$wrapper.css(this._getMaxDims()); 2325 } 2326 }, { 2327 key: '_resize', 2328 value: function _resize() { 2329 this.$wrapper.css({ 'max-width': 'none', 'min-height': 'none' }); 2330 // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths 2331 this.$wrapper.css(this._getMaxDims()); 2332 } 2333 2334 /** 2335 * Adds event handlers to elements in the menu. 2336 * @function 2337 * @private 2338 * @param {jQuery} $elem - the current menu item to add handlers to. 2339 */ 2340 2341 }, { 2342 key: '_events', 2343 value: function _events($elem) { 2344 var _this = this; 2345 2346 $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 2347 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) { 2348 e.stopImmediatePropagation(); 2349 e.preventDefault(); 2350 } 2351 2352 // if(e.target !== e.currentTarget.firstElementChild){ 2353 // return false; 2354 // } 2355 _this._show($elem.parent('li')); 2356 2357 if (_this.options.closeOnClick) { 2358 var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body'); 2359 $body.off('.zf.drilldown').on('click.zf.drilldown', function (e) { 2360 if (e.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(_this.$element[0], e.target)) { 2361 return; 2362 } 2363 e.preventDefault(); 2364 _this._hideAll(); 2365 $body.off('.zf.drilldown'); 2366 }); 2367 } 2368 }); 2369 } 2370 2371 /** 2372 * Adds event handlers to the menu element. 2373 * @function 2374 * @private 2375 */ 2376 2377 }, { 2378 key: '_registerEvents', 2379 value: function _registerEvents() { 2380 if (this.options.scrollTop) { 2381 this._bindHandler = this._scrollTop.bind(this); 2382 this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown', this._bindHandler); 2383 } 2384 this.$element.on('mutateme.zf.trigger', this._resize.bind(this)); 2385 } 2386 2387 /** 2388 * Scroll to Top of Element or data-scroll-top-element 2389 * @function 2390 * @fires Drilldown#scrollme 2391 */ 2392 2393 }, { 2394 key: '_scrollTop', 2395 value: function _scrollTop() { 2396 var _this = this; 2397 var $scrollTopElement = _this.options.scrollTopElement != '' ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()(_this.options.scrollTopElement) : _this.$element, 2398 scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10); 2399 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').stop(true).animate({ scrollTop: scrollPos }, _this.options.animationDuration, _this.options.animationEasing, function () { 2400 /** 2401 * Fires after the menu has scrolled 2402 * @event Drilldown#scrollme 2403 */ 2404 if (this === __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown'); 2405 }); 2406 } 2407 2408 /** 2409 * Adds keydown event listener to `li`'s in the menu. 2410 * @private 2411 */ 2412 2413 }, { 2414 key: '_keyboardEvents', 2415 value: function _keyboardEvents() { 2416 var _this = this; 2417 2418 this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) { 2419 var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 2420 $elements = $element.parent('li').parent('ul').children('li').children('a'), 2421 $prevElement, 2422 $nextElement; 2423 2424 $elements.each(function (i) { 2425 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) { 2426 $prevElement = $elements.eq(Math.max(0, i - 1)); 2427 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 2428 return; 2429 } 2430 }); 2431 2432 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Drilldown', { 2433 next: function () { 2434 if ($element.is(_this.$submenuAnchors)) { 2435 _this._show($element.parent('li')); 2436 $element.parent('li').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])($element), function () { 2437 $element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus(); 2438 }); 2439 return true; 2440 } 2441 }, 2442 previous: function () { 2443 _this._hide($element.parent('li').parent('ul')); 2444 $element.parent('li').parent('ul').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])($element), function () { 2445 setTimeout(function () { 2446 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 2447 }, 1); 2448 }); 2449 return true; 2450 }, 2451 up: function () { 2452 $prevElement.focus(); 2453 // Don't tap focus on first element in root ul 2454 return !$element.is(_this.$element.find('> li:first-child > a')); 2455 }, 2456 down: function () { 2457 $nextElement.focus(); 2458 // Don't tap focus on last element in root ul 2459 return !$element.is(_this.$element.find('> li:last-child > a')); 2460 }, 2461 close: function () { 2462 // Don't close on element in root ul 2463 if (!$element.is(_this.$element.find('> li > a'))) { 2464 _this._hide($element.parent().parent()); 2465 $element.parent().parent().siblings('a').focus(); 2466 } 2467 }, 2468 open: function () { 2469 if (!$element.is(_this.$menuItems)) { 2470 // not menu item means back button 2471 _this._hide($element.parent('li').parent('ul')); 2472 $element.parent('li').parent('ul').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])($element), function () { 2473 setTimeout(function () { 2474 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 2475 }, 1); 2476 }); 2477 return true; 2478 } else if ($element.is(_this.$submenuAnchors)) { 2479 _this._show($element.parent('li')); 2480 $element.parent('li').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])($element), function () { 2481 $element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus(); 2482 }); 2483 return true; 2484 } 2485 }, 2486 handled: function (preventDefault) { 2487 if (preventDefault) { 2488 e.preventDefault(); 2489 } 2490 e.stopImmediatePropagation(); 2491 } 2492 }); 2493 }); // end keyboardAccess 2494 } 2495 2496 /** 2497 * Closes all open elements, and returns to root menu. 2498 * @function 2499 * @fires Drilldown#closed 2500 */ 2501 2502 }, { 2503 key: '_hideAll', 2504 value: function _hideAll() { 2505 var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing'); 2506 if (this.options.autoHeight) this.$wrapper.css({ height: $elem.parent().closest('ul').data('calcHeight') }); 2507 $elem.one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])($elem), function (e) { 2508 $elem.removeClass('is-active is-closing'); 2509 }); 2510 /** 2511 * Fires when the menu is fully closed. 2512 * @event Drilldown#closed 2513 */ 2514 this.$element.trigger('closed.zf.drilldown'); 2515 } 2516 2517 /** 2518 * Adds event listener for each `back` button, and closes open menus. 2519 * @function 2520 * @fires Drilldown#back 2521 * @param {jQuery} $elem - the current sub-menu to add `back` event. 2522 */ 2523 2524 }, { 2525 key: '_back', 2526 value: function _back($elem) { 2527 var _this = this; 2528 $elem.off('click.zf.drilldown'); 2529 $elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) { 2530 e.stopImmediatePropagation(); 2531 // console.log('mouseup on back'); 2532 _this._hide($elem); 2533 2534 // If there is a parent submenu, call show 2535 var parentSubMenu = $elem.parent('li').parent('ul').parent('li'); 2536 if (parentSubMenu.length) { 2537 _this._show(parentSubMenu); 2538 } 2539 }); 2540 } 2541 2542 /** 2543 * Adds event listener to menu items w/o submenus to close open menus on click. 2544 * @function 2545 * @private 2546 */ 2547 2548 }, { 2549 key: '_menuLinkEvents', 2550 value: function _menuLinkEvents() { 2551 var _this = this; 2552 this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 2553 // e.stopImmediatePropagation(); 2554 setTimeout(function () { 2555 _this._hideAll(); 2556 }, 0); 2557 }); 2558 } 2559 2560 /** 2561 * Opens a submenu. 2562 * @function 2563 * @fires Drilldown#open 2564 * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag. 2565 */ 2566 2567 }, { 2568 key: '_show', 2569 value: function _show($elem) { 2570 if (this.options.autoHeight) this.$wrapper.css({ height: $elem.children('[data-submenu]').data('calcHeight') }); 2571 $elem.attr('aria-expanded', true); 2572 $elem.children('[data-submenu]').addClass('is-active').removeClass('invisible').attr('aria-hidden', false); 2573 /** 2574 * Fires when the submenu has opened. 2575 * @event Drilldown#open 2576 */ 2577 this.$element.trigger('open.zf.drilldown', [$elem]); 2578 } 2579 }, { 2580 key: '_hide', 2581 2582 2583 /** 2584 * Hides a submenu 2585 * @function 2586 * @fires Drilldown#hide 2587 * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag. 2588 */ 2589 value: function _hide($elem) { 2590 if (this.options.autoHeight) this.$wrapper.css({ height: $elem.parent().closest('ul').data('calcHeight') }); 2591 var _this = this; 2592 $elem.parent('li').attr('aria-expanded', false); 2593 $elem.attr('aria-hidden', true).addClass('is-closing'); 2594 $elem.addClass('is-closing').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])($elem), function () { 2595 $elem.removeClass('is-active is-closing'); 2596 $elem.blur().addClass('invisible'); 2597 }); 2598 /** 2599 * Fires when the submenu has closed. 2600 * @event Drilldown#hide 2601 */ 2602 $elem.trigger('hide.zf.drilldown', [$elem]); 2603 } 2604 2605 /** 2606 * Iterates through the nested menus to calculate the min-height, and max-width for the menu. 2607 * Prevents content jumping. 2608 * @function 2609 * @private 2610 */ 2611 2612 }, { 2613 key: '_getMaxDims', 2614 value: function _getMaxDims() { 2615 var maxHeight = 0, 2616 result = {}, 2617 _this = this; 2618 this.$submenus.add(this.$element).each(function () { 2619 var numOfElems = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('li').length; 2620 var height = __WEBPACK_IMPORTED_MODULE_4__foundation_util_box__["a" /* Box */].GetDimensions(this).height; 2621 maxHeight = height > maxHeight ? height : maxHeight; 2622 if (_this.options.autoHeight) { 2623 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('calcHeight', height); 2624 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).hasClass('is-drilldown-submenu')) result['height'] = height; 2625 } 2626 }); 2627 2628 if (!this.options.autoHeight) result['min-height'] = maxHeight + 'px'; 2629 2630 result['max-width'] = this.$element[0].getBoundingClientRect().width + 'px'; 2631 2632 return result; 2633 } 2634 2635 /** 2636 * Destroys the Drilldown Menu 2637 * @function 2638 */ 2639 2640 }, { 2641 key: '_destroy', 2642 value: function _destroy() { 2643 if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler); 2644 this._hideAll(); 2645 this.$element.off('mutateme.zf.trigger'); 2646 __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["a" /* Nest */].Burn(this.$element, 'drilldown'); 2647 this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role'); 2648 this.$submenuAnchors.each(function () { 2649 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).off('.zf.drilldown'); 2650 }); 2651 2652 this.$submenus.removeClass('drilldown-submenu-cover-previous invisible'); 2653 2654 this.$element.find('a').each(function () { 2655 var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this); 2656 $link.removeAttr('tabindex'); 2657 if ($link.data('savedHref')) { 2658 $link.attr('href', $link.data('savedHref')).removeData('savedHref'); 2659 } else { 2660 return; 2661 } 2662 }); 2663 } 2664 }]); 2665 2666 return Drilldown; 2667}(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__["a" /* Plugin */]); 2668 2669Drilldown.defaults = { 2670 /** 2671 * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are 2672 * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization. 2673 * @option 2674 * @type {boolian} 2675 * @default true 2676 */ 2677 autoApplyClass: true, 2678 /** 2679 * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting. 2680 * @option 2681 * @type {string} 2682 * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>' 2683 */ 2684 backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>', 2685 /** 2686 * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`. 2687 * @option 2688 * @type {string} 2689 * @default top 2690 */ 2691 backButtonPosition: 'top', 2692 /** 2693 * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting. 2694 * @option 2695 * @type {string} 2696 * @default '<div></div>' 2697 */ 2698 wrapper: '<div></div>', 2699 /** 2700 * Adds the parent link to the submenu. 2701 * @option 2702 * @type {boolean} 2703 * @default false 2704 */ 2705 parentLink: false, 2706 /** 2707 * Allow the menu to return to root list on body click. 2708 * @option 2709 * @type {boolean} 2710 * @default false 2711 */ 2712 closeOnClick: false, 2713 /** 2714 * Allow the menu to auto adjust height. 2715 * @option 2716 * @type {boolean} 2717 * @default false 2718 */ 2719 autoHeight: false, 2720 /** 2721 * Animate the auto adjust height. 2722 * @option 2723 * @type {boolean} 2724 * @default false 2725 */ 2726 animateHeight: false, 2727 /** 2728 * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button 2729 * @option 2730 * @type {boolean} 2731 * @default false 2732 */ 2733 scrollTop: false, 2734 /** 2735 * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken 2736 * @option 2737 * @type {string} 2738 * @default '' 2739 */ 2740 scrollTopElement: '', 2741 /** 2742 * ScrollTop offset 2743 * @option 2744 * @type {number} 2745 * @default 0 2746 */ 2747 scrollTopOffset: 0, 2748 /** 2749 * Scroll animation duration 2750 * @option 2751 * @type {number} 2752 * @default 500 2753 */ 2754 animationDuration: 500, 2755 /** 2756 * Scroll animation easing. Can be `'swing'` or `'linear'`. 2757 * @option 2758 * @type {string} 2759 * @see {@link https://api.jquery.com/animate|JQuery animate} 2760 * @default 'swing' 2761 */ 2762 animationEasing: 'swing' 2763 // holdOpen: false 2764}; 2765 2766 2767 2768/***/ }), 2769/* 13 */ 2770/***/ (function(module, __webpack_exports__, __webpack_require__) { 2771 2772"use strict"; 2773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DropdownMenu; }); 2774/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 2775/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 2776/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 2777/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9); 2778/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_box__ = __webpack_require__(7); 2779/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_core__ = __webpack_require__(1); 2780/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin__ = __webpack_require__(2); 2781 2782 2783var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 2784 2785function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2786 2787function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 2788 2789function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
2789onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 2790 2791 2792 2793 2794 2795 2796 2797 2798/** 2799 * DropdownMenu module. 2800 * @module foundation.dropdown-menu 2801 * @requires foundation.util.keyboard 2802 * @requires foundation.util.box 2803 * @requires foundation.util.nest 2804 */ 2805 2806var DropdownMenu = function (_Plugin) { 2807 _inherits(DropdownMenu, _Plugin); 2808 2809 function DropdownMenu() { 2810 _classCallCheck(this, DropdownMenu); 2811 2812 return _possibleConstructorReturn(this, (DropdownMenu.__proto__ || Object.getPrototypeOf(DropdownMenu)).apply(this, arguments)); 2813 } 2814 2815 _createClass(DropdownMenu, [{ 2816 key: '_setup', 2817 2818 /** 2819 * Creates a new instance of DropdownMenu. 2820 * @class 2821 * @name DropdownMenu 2822 * @fires DropdownMenu#init 2823 * @param {jQuery} element - jQuery object to make into a dropdown menu. 2824 * @param {Object} options - Overrides to the default plugin settings. 2825 */ 2826 value: function _setup(element, options) { 2827 this.$element = element; 2828 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options); 2829 this.className = 'DropdownMenu'; // ie9 back compat 2830 2831 this._init(); 2832 2833 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('DropdownMenu', { 2834 'ENTER': 'open', 2835 'SPACE': 'open', 2836 'ARROW_RIGHT': 'next', 2837 'ARROW_UP': 'up', 2838 'ARROW_DOWN': 'down', 2839 'ARROW_LEFT': 'previous', 2840 'ESCAPE': 'close' 2841 }); 2842 } 2843 2844 /** 2845 * Initializes the plugin, and calls _prepareMenu 2846 * @private 2847 * @function 2848 */ 2849 2850 }, { 2851 key: '_init', 2852 value: function _init() { 2853 __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["a" /* Nest */].Feather(this.$element, 'dropdown'); 2854 2855 var subs = this.$element.find('li.is-dropdown-submenu-parent'); 2856 this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub'); 2857 2858 this.$menuItems = this.$element.find('[role="menuitem"]'); 2859 this.$tabs = this.$element.children('[role="menuitem"]'); 2860 this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass); 2861 2862 if (this.options.alignment === 'auto') { 2863 if (this.$element.hasClass(this.options.rightClass) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__foundation_util_core__["b" /* rtl */])() || this.$element.parents('.top-bar-right').is('*')) { 2864 this.options.alignment = 'right'; 2865 subs.addClass('opens-left'); 2866 } else { 2867 this.options.alignment = 'left'; 2868 subs.addClass('opens-right'); 2869 } 2870 } else { 2871 if (this.options.alignment === 'right') { 2872 subs.addClass('opens-left'); 2873 } else { 2874 subs.addClass('opens-right'); 2875 } 2876 } 2877 this.changed = false; 2878 this._events(); 2879 } 2880 }, { 2881 key: '_isVertical', 2882 value: function _isVertical() { 2883 return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column'; 2884 } 2885 }, { 2886 key: '_isRtl', 2887 value: function _isRtl() { 2888 return this.$element.hasClass('align-right') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__foundation_util_core__["b" /* rtl */])() && !this.$element.hasClass('align-left'); 2889 } 2890 2891 /** 2892 * Adds event listeners to elements within the menu 2893 * @private 2894 * @function 2895 */ 2896 2897 }, { 2898 key: '_events', 2899 value: function _events() { 2900 var _this = this, 2901 hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined', 2902 parClass = 'is-dropdown-submenu-parent'; 2903 2904 // used for onClick and in the keyboard handlers 2905 var handleClickFn = function (e) { 2906 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', '.' + parClass), 2907 hasSub = $elem.hasClass(parClass), 2908 hasClicked = $elem.attr('data-is-click') === 'true', 2909 $sub = $elem.children('.is-dropdown-submenu'); 2910 2911 if (hasSub) { 2912 if (hasClicked) { 2913 if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) { 2914 return; 2915 } else { 2916 e.stopImmediatePropagation(); 2917 e.preventDefault(); 2918 _this._hide($elem); 2919 } 2920 } else { 2921 e.preventDefault(); 2922 e.stopImmediatePropagation(); 2923 _this._show($sub); 2924 $elem.add($elem.parentsUntil(_this.$element, '.' + parClass)).attr('data-is-click', true); 2925 } 2926 } 2927 }; 2928 2929 if (this.options.clickOpen || hasTouch) { 2930 this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClick
vendor: 6,236 bytes, lines 2930-3109
2930Fn); 2931 } 2932 2933 // Handle Leaf element Clicks 2934 if (_this.options.closeOnClickInside) { 2935 this.$menuItems.on('click.zf.dropdownmenu', function (e) { 2936 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 2937 hasSub = $elem.hasClass(parClass); 2938 if (!hasSub) { 2939 _this._hide(); 2940 } 2941 }); 2942 } 2943 2944 if (!this.options.disableHover) { 2945 this.$menuItems.on('mouseenter.zf.dropdownmenu', function (e) { 2946 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 2947 hasSub = $elem.hasClass(parClass); 2948 2949 if (hasSub) { 2950 clearTimeout($elem.data('_delay')); 2951 $elem.data('_delay', setTimeout(function () { 2952 _this._show($elem.children('.is-dropdown-submenu')); 2953 }, _this.options.hoverDelay)); 2954 } 2955 }).on('mouseleave.zf.dropdownmenu', function (e) { 2956 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 2957 hasSub = $elem.hasClass(parClass); 2958 if (hasSub && _this.options.autoclose) { 2959 if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { 2960 return false; 2961 } 2962 2963 clearTimeout($elem.data('_delay')); 2964 $elem.data('_delay', setTimeout(function () { 2965 _this._hide($elem); 2966 }, _this.options.closingTime)); 2967 } 2968 }); 2969 } 2970 this.$menuItems.on('keydown.zf.dropdownmenu', function (e) { 2971 var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', '[role="menuitem"]'), 2972 isTab = _this.$tabs.index($element) > -1, 2973 $elements = isTab ? _this.$tabs : $element.siblings('li').add($element), 2974 $prevElement, 2975 $nextElement; 2976 2977 $elements.each(function (i) { 2978 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) { 2979 $prevElement = $elements.eq(i - 1); 2980 $nextElement = $elements.eq(i + 1); 2981 return; 2982 } 2983 }); 2984 2985 var nextSibling = function () { 2986 $nextElement.children('a:first').focus(); 2987 e.preventDefault(); 2988 }, 2989 prevSibling = function () { 2990 $prevElement.children('a:first').focus(); 2991 e.preventDefault(); 2992 }, 2993 openSub = function () { 2994 var $sub = $element.children('ul.is-dropdown-submenu'); 2995 if ($sub.length) { 2996 _this._show($sub); 2997 $element.find('li > a:first').focus(); 2998 e.preventDefault(); 2999 } else { 3000 return; 3001 } 3002 }, 3003 closeSub = function () { 3004 //if ($element.is(':first-child')) { 3005 var close = $element.parent('ul').parent('li'); 3006 close.children('a:first').focus(); 3007 _this._hide(close); 3008 e.preventDefault(); 3009 //} 3010 }; 3011 var functions = { 3012 open: openSub, 3013 close: function () { 3014 _this._hide(_this.$element); 3015 _this.$menuItems.eq(0).children('a').focus(); // focus to first element 3016 e.preventDefault(); 3017 }, 3018 handled: function () { 3019 e.stopImmediatePropagation(); 3020 } 3021 }; 3022 3023 if (isTab) { 3024 if (_this._isVertical()) { 3025 // vertical menu 3026 if (_this._isRtl()) { 3027 // right aligned 3028 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, { 3029 down: nextSibling, 3030 up: prevSibling, 3031 next: closeSub, 3032 previous: openSub 3033 }); 3034 } else { 3035 // left aligned 3036 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, { 3037 down: nextSibling, 3038 up: prevSibling, 3039 next: openSub, 3040 previous: closeSub 3041 }); 3042 } 3043 } else { 3044 // horizontal menu 3045 if (_this._isRtl()) { 3046 // right aligned 3047 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, { 3048 next: prevSibling, 3049 previous: nextSibling, 3050 down: openSub, 3051 up: closeSub 3052 }); 3053 } else { 3054 // left aligned 3055 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, { 3056 next: nextSibling, 3057 previous: prevSibling, 3058 down: openSub, 3059 up: closeSub 3060 }); 3061 } 3062 } 3063 } else { 3064 // not tabs -> one sub 3065 if (_this._isRtl()) { 3066 // right aligned 3067 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, { 3068 next: closeSub, 3069 previous: openSub, 3070 down: nextSibling, 3071 up: prevSibling 3072 }); 3073 } else { 3074 // left aligned 3075 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, { 3076 next: openSub, 3077 previous: closeSub, 3078 down: nextSibling, 3079 up: prevSibling 3080 }); 3081 } 3082 } 3083 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'DropdownMenu', functions); 3084 }); 3085 } 3086 3087 /** 3088 * Adds an event handler to the body to close any dropdowns on a click. 3089 * @function 3090 * @private 3091 */ 3092 3093 }, { 3094 key: '_addBodyHandler', 3095 value: function _addBodyHandler() { 3096 var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document.body), 3097 _this = this; 3098 $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu').on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu', function (e) { 3099 var $link = _this.$element.find(e.target); 3100 if ($link.length) { 3101 return; 3102 } 3103 3104 _this._hide(); 3105 $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu'); 3106 }); 3107 } 3108 3109 /**
3110 * Opens a dropdown pane, and checks for collisions first. 3111 * @param {jQuery} $sub - ul element that is a submenu to show 3112 * @function 3113 * @private 3114 * @fires DropdownMenu#show 3115 */ 3116 3117 }, { 3118 key: '_show', 3119 value: function _show($sub) { 3120 var idx = this.$tabs.index(this.$tabs.filter(function (i, el) { 3121 return __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el).find($sub).length > 0; 3122 })); 3123 var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent'); 3124 this._hide($sibs, idx); 3125 $sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active'); 3126 var clear = __WEBPACK_IMPORTED_MODULE_3__foundation_util_box__["a" /* Box */].ImNotTouchingYou($sub, null, true); 3127 if (!clear) { 3128 var oldClass = this.options.alignment === 'left' ? '-right' : '-left', 3129 $parentLi = $sub.parent('.is-dropdown-submenu-parent'); 3130 $parentLi.removeClass('opens' + oldClass).addClass('opens-' + this.options.alignment); 3131 clear = __WEBPACK_IMPORTED_MODULE_3__foundation_util_box__["a" /* Box */].ImNotTouchingYou($sub, null, true); 3132 if (!clear) { 3133 $parentLi.removeClass('opens-' + this.options.alignment).addClass('opens-inner'); 3134 } 3135 this.changed = true; 3136 } 3137 $sub.css('visibility', ''); 3138 if (this.options.closeOnClick) { 3139 this._addBodyHandler(); 3140 } 3141 /** 3142 * Fires when the new dropdown pane is visible. 3143 * @event DropdownMenu#show 3144 */ 3145 this.$element.trigger('show.zf.dropdownmenu', [$sub]); 3146 } 3147 3148 /** 3149 * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything. 3150 * @function 3151 * @param {jQuery} $elem - element with a submenu to hide 3152 * @param {Number} idx - index of the $tabs collection to hide 3153 * @private 3154 */ 3155 3156 }, { 3157 key: '_hide', 3158 value: function _hide($elem, idx) { 3159 var $toClose; 3160 if ($elem && $elem.length) { 3161 $toClose = $elem; 3162 } else if (idx !== undefined) { 3163 $toClose = this.$tabs.not(function (i, el) { 3164 return i === idx; 3165 }); 3166 } else { 3167 $toClose = this.$element; 3168 } 3169 var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0; 3170 3171 if (somethingToClose) { 3172 $toClose.find('li.is-active').add($toClose).attr({ 3173 'data-is-click': false 3174 }).removeClass('is-active'); 3175 3176 $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active'); 3177 3178 if (this.changed || $toClose.find('opens-inner').length) { 3179 var oldClass = this.options.alignment === 'left' ? 'right' : 'left'; 3180 $toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass('opens-inner opens-' + this.options.alignment).addClass('opens-' + oldClass); 3181 this.changed = false; 3182 } 3183 /** 3184 * Fires when the open menus are closed. 3185 * @event DropdownMenu#hide 3186 */ 3187 this.$element.trigger('hide.zf.dropdownmenu', [$toClose]); 3188 } 3189 } 3190 3191 /** 3192 * Destroys the plugin. 3193 * @function 3194 */ 3195 3196 }, { 3197 key: '_destroy', 3198 value: function _destroy() { 3199 this.$menuItems.off('.zf.dropdownmenu').removeAttr('data-is-click').removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner'); 3200 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document.body).off('.zf.dropdownmenu'); 3201 __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["a" /* Nest */].Burn(this.$element, 'dropdown'); 3202 } 3203 }]); 3204 3205 return DropdownMenu; 3206}(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__["a" /* Plugin */]); 3207 3208/** 3209 * Default settings for plugin 3210 */ 3211 3212 3213DropdownMenu.defaults = { 3214 /** 3215 * Disallows hover events from opening submenus 3216 * @option 3217 * @type {boolean} 3218 * @default false 3219 */ 3220 disableHover: false, 3221 /** 3222 * Allow a submenu to automatically close on a mouseleave event, if not clicked open. 3223 * @option 3224 * @type {boolean} 3225 * @default true 3226 */ 3227 autoclose: true, 3228 /** 3229 * Amount of time to delay opening a submenu on hover event. 3230 * @option 3231 * @type {number} 3232 * @default 50 3233 */ 3234 hoverDelay: 50, 3235 /** 3236 * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu. 3237 * @option 3238 * @type {boolean} 3239 * @default false 3240 */ 3241 clickOpen: false, 3242 /** 3243 * Amount of time to delay closing a submenu on a mouseleave event. 3244 * @option 3245 * @type {number} 3246 * @default 500 3247 */ 3248 3249 closingTime: 500, 3250 /** 3251 * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`. 3252 * @option 3253 * @type {string} 3254 * @default 'auto' 3255 */ 3256 alignment: 'auto', 3257 /** 3258 * Allow clicks on the body to close any open submenus. 3259 * @option 3260 * @type {boolean} 3261 * @default true 3262 */ 3263 closeOnClick: true, 3264 /** 3265 * Allow clicks on leaf anchor links to close any open submenus. 3266 * @option 3267 * @type {boolean} 3268 * @default true 3269 */ 3270 closeOnClickInside: true, 3271 /** 3272 * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. 3273 * @option 3274 * @type {string} 3275 * @default 'vertical' 3276 */ 3277 verticalClass: 'vertical', 3278 /** 3279 * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class. 3280 * @option 3281 * @type {string} 3282 * @default 'align-right' 3283 */ 3284 rightClass: 'align-right', 3285 /** 3286 * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile. 3287 * @option 3288 * @type {boolean} 3289 * @default true 3290 */ 3291 forceFollow: true 3292}; 3293 3294 3295 3296/***/ }), 3297/* 14 */ 3298/***/ (function(module, __webpack_exports__, __webpack_require__) { 3299 3300"use strict"; 3301/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Tabs; }); 3302/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 3303/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 3304/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 3305/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__ = __webpack_require__(8); 3306/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2); 3307 3308 3309var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 3310 3311function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3312 3313function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 3314 3315function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
3315onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 3316 3317 3318 3319 3320 3321/** 3322 * Tabs module. 3323 * @module foundation.tabs 3324 * @requires foundation.util.keyboard 3325 * @requires foundation.util.imageLoader if tabs contain images 3326 */ 3327 3328var Tabs = function (_Plugin) { 3329 _inherits(Tabs, _Plugin); 3330 3331 function Tabs() { 3332 _classCallCheck(this, Tabs); 3333 3334 return _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).apply(this, arguments)); 3335 } 3336 3337 _createClass(Tabs, [{ 3338 key: '_setup', 3339 3340 /** 3341 * Creates a new instance of tabs. 3342 * @class 3343 * @name Tabs 3344 * @fires Tabs#init 3345 * @param {jQuery} element - jQuery object to make into tabs. 3346 * @param {Object} options - Overrides to the default plugin settings. 3347 */ 3348 value: function _setup(element, options) { 3349 this.$element = element; 3350 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Tabs.defaults, this.$element.data(), options); 3351 this.className = 'Tabs'; // ie9 back compat 3352 3353 this._init(); 3354 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Tabs', { 3355 'ENTER': 'open', 3356 'SPACE': 'open', 3357 'ARROW_RIGHT': 'next', 3358 'ARROW_UP': 'previous', 3359 'ARROW_DOWN': 'next', 3360 'ARROW_LEFT': 'previous' 3361 // 'TAB': 'next', 3362 // 'SHIFT_TAB': 'previous' 3363 }); 3364 } 3365 3366 /** 3367 * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab. 3368 * @private 3369 */ 3370 3371 }, { 3372 key: '_init', 3373 value: function _init() { 3374 var _this3 = this; 3375 3376 var _this = this; 3377 3378 this.$element.attr({ 'role': 'tablist' }); 3379 this.$tabTitles = this.$element.find('.' + this.options.linkClass); 3380 this.$tabContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content="' + this.$element[0].id + '"]'); 3381 3382 this.$tabTitles.each(function () { 3383 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 3384 $link = $elem.find('a'), 3385 isActive = $elem.hasClass('' + _this.options.linkActiveClass), 3386 hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1), 3387 linkId = $link[0].id ? $link[0].id : hash + '-label', 3388 $tabContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + hash); 3389 3390 $elem.attr({ 'role': 'presentation' }); 3391 3392 $link.attr({ 3393 'role': 'tab', 3394 'aria-controls': hash, 3395 'aria-selected': isActive, 3396 'id': linkId, 3397 'tabindex': isActive ? '0' : '-1' 3398 }); 3399 3400 $tabContent.attr({ 3401 'role': 'tabpanel', 3402 'aria-labelledby': linkId 3403 }); 3404 3405 if (!isActive) { 3406 $tabContent.attr('aria-hidden', 'true'); 3407 } 3408 3409 if (isActive && _this.options.autoFocus) { 3410 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).load(function () { 3411 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, function () { 3412 $link.focus(); 3413 }); 3414 }); 3415 } 3416 }); 3417 if (this.options.matchHeight) { 3418 var $images = this.$tabContent.find('img'); 3419 3420 if ($images.length) { 3421 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__["a" /* onImagesLoaded */])($images, this._setHeight.bind(this)); 3422 } else { 3423 this._setHeight(); 3424 } 3425 } 3426 3427 //current context-bound function to open tabs on page load or history popstate 3428 this._checkDeepLink = function () { 3429 var anchor = window.location.hash; 3430 //need a hash and a relevant anchor in this tabset 3431 if (anchor.length) { 3432 var $link = _this3.$element.find('[href$="' + anchor + '"]'); 3433 if ($link.length) { 3434 _this3.selectTab(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor), true); 3435 3436 //roll up a little to show the titles 3437 if (_this3.options.deepLinkSmudge) { 3438 var offset = _this3.$element.offset(); 3439 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: offset.top }, _this3.options.deepLinkSmudgeDelay); 3440 } 3441 3442 /** 3443 * Fires when the zplugin has deeplinked at pageload 3444 * @event Tabs#deeplink 3445 */ 3446 _this3.$element.trigger('deeplink.zf.tabs', [$link, __WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor)]); 3447 } 3448 } 3449 }; 3450 3451 //use browser to open a tab, if it exists in this tabset 3452 if (this.options.deepLink) { 3453 this._checkDeepLink(); 3454 } 3455 3456 this._events(); 3457 } 3458 3459 /** 3460 * Adds event handlers for items within the tabs. 3461 * @private 3462 */ 3463 3464 }, { 3465 key: '_events', 3466 value: function _events() { 3467 this._addKeyHandler(); 3468 this._addClickHandler(); 3469 this._setHeightMqHandler = null; 3470 3471 if (this.options.matchHeight) { 3472 this._setHeightMqHandler = this._setHeight.bind(this); 3473 3474 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler); 3475 } 3476 3477 if (this.options.deepLink) { 3478 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._checkDeepLink); 3479 } 3480 } 3481 3482 /** 3483 * Adds click handlers for items within the tabs. 3484 * @private 3485 */ 3486 3487 }, { 3488 key: '_addClickHandler', 3489 value: function _addClickHandler() { 3490 var _this = this; 3491 3492 this.$element.off('click.zf.tabs').on('click.zf.tabs', '.' + this.options.linkClass, function (e) { 3493 e.preventDefault(); 3494 e.stopPropagation(); 3495 _this._handleTabChange(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)); 3496 }); 3497 } 3498 3499 /** 3500 * Adds keyboard event handlers for items within the tabs. 3501 * @private 3502 */ 3503 3504 }, { 3505 key: '_addKeyHandler', 3506 value: function _addKeyHandler() { 3507 var _this = this; 3508 3509 this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) { 3510 if (e.which === 9) return; 3511 3512 var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 3513 $elements = $element.parent('ul').children('li'), 3514 $prevElement, 3515 $nextElement; 3516 3517 $elements.each(function (i) { 3518 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) { 3519 if (_this.options.wrapOnKeys) {
3520 $prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1); 3521 $nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1); 3522 } else { 3523 $prevElement = $elements.eq(Math.max(0, i - 1)); 3524 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 3525 } 3526 return; 3527 } 3528 }); 3529 3530 // handle keyboard event with keyboard util 3531 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Tabs', { 3532 open: function () { 3533 $element.find('[role="tab"]').focus(); 3534 _this._handleTabChange($element); 3535 }, 3536 previous: function () { 3537 $prevElement.find('[role="tab"]').focus(); 3538 _this._handleTabChange($prevElement); 3539 }, 3540 next: function () { 3541 $nextElement.find('[role="tab"]').focus(); 3542 _this._handleTabChange($nextElement); 3543 }, 3544 handled: function () { 3545 e.stopPropagation(); 3546 e.preventDefault(); 3547 } 3548 }); 3549 }); 3550 } 3551 3552 /** 3553 * Opens the tab `$targetContent` defined by `$target`. Collapses active tab. 3554 * @param {jQuery} $target - Tab to open. 3555 * @param {boolean} historyHandled - browser has already handled a history update 3556 * @fires Tabs#change 3557 * @function 3558 */ 3559 3560 }, { 3561 key: '_handleTabChange', 3562 value: function _handleTabChange($target, historyHandled) { 3563 3564 /** 3565 * Check for active class on target. Collapse if exists. 3566 */ 3567 if ($target.hasClass('' + this.options.linkActiveClass)) { 3568 if (this.options.activeCollapse) { 3569 this._collapseTab($target); 3570 3571 /** 3572 * Fires when the zplugin has successfully collapsed tabs. 3573 * @event Tabs#collapse 3574 */ 3575 this.$element.trigger('collapse.zf.tabs', [$target]); 3576 } 3577 return; 3578 } 3579 3580 var $oldTab = this.$element.find('.' + this.options.linkClass + '.' + this.options.linkActiveClass), 3581 $tabLink = $target.find('[role="tab"]'), 3582 hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1), 3583 $targetContent = this.$tabContent.find('#' + hash); 3584 3585 //close old tab 3586 this._collapseTab($oldTab); 3587 3588 //open new tab 3589 this._openTab($target); 3590 3591 //either replace or update browser history 3592 if (this.options.deepLink && !historyHandled) { 3593 var anchor = $target.find('a').attr('href'); 3594 3595 if (this.options.updateHistory) { 3596 history.pushState({}, '', anchor); 3597 } else { 3598 history.replaceState({}, '', anchor); 3599 } 3600 } 3601 3602 /** 3603 * Fires when the plugin has successfully changed tabs. 3604 * @event Tabs#change 3605 */ 3606 this.$element.trigger('change.zf.tabs', [$target, $targetContent]); 3607 3608 //fire to children a mutation event 3609 $targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger"); 3610 } 3611 3612 /** 3613 * Opens the tab `$targetContent` defined by `$target`. 3614 * @param {jQuery} $target - Tab to Open. 3615 * @function 3616 */ 3617 3618 }, { 3619 key: '_openTab', 3620 value: function _openTab($target) { 3621 var $tabLink = $target.find('[role="tab"]'), 3622 hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1), 3623 $targetContent = this.$tabContent.find('#' + hash); 3624 3625 $target.addClass('' + this.options.linkActiveClass); 3626 3627 $tabLink.attr({ 3628 'aria-selected': 'true', 3629 'tabindex': '0' 3630 }); 3631 3632 $targetContent.addClass('' + this.options.panelActiveClass).removeAttr('aria-hidden'); 3633 } 3634 3635 /** 3636 * Collapses `$targetContent` defined by `$target`. 3637 * @param {jQuery} $target - Tab to Open. 3638 * @function 3639 */ 3640 3641 }, { 3642 key: '_collapseTab', 3643 value: function _collapseTab($target) { 3644 var $target_anchor = $target.removeClass('' + this.options.linkActiveClass).find('[role="tab"]').attr({ 3645 'aria-selected': 'false', 3646 'tabindex': -1 3647 }); 3648 3649 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target_anchor.attr('aria-controls')).removeClass('' + this.options.panelActiveClass).attr({ 'aria-hidden': 'true' }); 3650 } 3651 3652 /** 3653 * Public method for selecting a content pane to display. 3654 * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display. 3655 * @param {boolean} historyHandled - browser has already handled a history update 3656 * @function 3657 */ 3658 3659 }, { 3660 key: 'selectTab', 3661 value: function selectTab(elem, historyHandled) { 3662 var idStr; 3663 3664 if (typeof elem === 'object') { 3665 idStr = elem[0].id; 3666 } else { 3667 idStr = elem; 3668 } 3669 3670 if (idStr.indexOf('#') < 0) { 3671 idStr = '#' + idStr; 3672 } 3673 3674 var $target = this.$tabTitles.find('[href$="' + idStr + '"]').parent('.' + this.options.linkClass); 3675 3676 this._handleTabChange($target, historyHandled); 3677 } 3678 }, { 3679 key: '_setHeight', 3680 3681 /** 3682 * Sets the height of each panel to the height of the tallest panel. 3683 * If enabled in options, gets called on media query change. 3684 * If loading content via external source, can be called directly or with _reflow. 3685 * If enabled with `data-match-height="true"`, tabs sets to equal height 3686 * @function 3687 * @private 3688 */ 3689 value: function _setHeight() { 3690 var max = 0, 3691 _this = this; // Lock down the `this` value for the root tabs object 3692 3693 this.$tabContent.find('.' + this.options.panelClass).css('height', '').each(function () { 3694 3695 var panel = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 3696 isActive = panel.hasClass('' + _this.options.panelActiveClass); // get the options from the parent instead of trying to get them from the child 3697 3698 if (!isActive) { 3699 panel.css({ 'visibility': 'hidden', 'display': 'block' }); 3700 } 3701 3702 var temp = this.getBoundingClientRect().height; 3703 3704 if (!isActive) { 3705 panel.css({ 3706 'visibility': '', 3707 'display': '' 3708 }); 3709 } 3710 3711 max = temp > max ? temp : max; 3712 }).css('height', max + 'px'); 3713 } 3714 3715 /** 3716 * Destroys an instance of an tabs. 3717 * @fires Tabs#destroyed 3718 */ 3719 3720 }, { 3721 key: '_destroy', 3722 value: function _destroy() { 3723 this.$element.find('.' + this.options.linkClass).off('.zf.tabs').hide().end().find('.' + this.options.panelClass).hide(); 3724 3725 if (this.options.matchHeight) { 3726 if (this._setHeightMqHandler != null) { 3727 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler); 3728 } 3729 } 3730 3731 if (this.options.deepLink) { 3732 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink); 3733 } 3734 } 3735 }]); 3736 3737 return Tabs; 3738}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */]); 3739 3740Tabs.defaults = { 3741 /** 3742 * Allows the window to scroll to content of pane specified by hash anchor 3743 * @option 3744 * @type {boolean} 3745 * @default false 3746 */ 3747 deepLink: false, 3748 3749 /** 3750 * Adjust the deep link scroll to make sure the top of the tab panel is visible 3751 * @option 3752 * @type {boolean} 3753 * @default false 3754 */ 3755 deepLinkSmudge: false, 3756 3757 /** 3758 * Animation time (ms) for the deep link adjustment 3759 * @option 3760 * @type {number} 3761 * @default 300 3762 */ 3763 deepLinkSmudgeDelay: 300, 3764 3765 /** 3766 * Update the browser history with the open tab 3767 * @option 3768 * @type {boolean} 3769 * @default false 3770 */ 3771 updateHistory: false, 3772 3773 /** 3774 * Allows the window to scroll to content of active pane on load if set to true. 3775 * Not recommended if more than one tab panel per page. 3776 * @option 3777 * @type {boolean} 3778 * @default false 3779 */ 3780 autoFocus: false, 3781 3782 /** 3783 * Allows keyboard input to 'wrap' around the tab links. 3784 * @option 3785 * @type {boolean} 3786 * @default true 3787 */ 3788 wrapOnKeys: true, 3789 3790 /**
3791 * Allows the tab content panes to match heights if set to true. 3792 * @option 3793 * @type {boolean} 3794 * @default false 3795 */ 3796 matchHeight: false, 3797 3798 /** 3799 * Allows active tabs to collapse when clicked. 3800 * @option 3801 * @type {boolean} 3802 * @default false 3803 */ 3804 activeCollapse: false, 3805 3806 /** 3807 * Class applied to `li`'s in tab link list. 3808 * @option 3809 * @type {string} 3810 * @default 'tabs-title' 3811 */ 3812 linkClass: 'tabs-title', 3813 3814 /** 3815 * Class applied to the active `li` in tab link list. 3816 * @option 3817 * @type {string} 3818 * @default 'is-active' 3819 */ 3820 linkActiveClass: 'is-active', 3821 3822 /** 3823 * Class applied to the content containers. 3824 * @option 3825 * @type {string} 3826 * @default 'tabs-panel' 3827 */ 3828 panelClass: 'tabs-panel', 3829 3830 /** 3831 * Class applied to the active content container. 3832 * @option 3833 * @type {string} 3834 * @default 'is-active' 3835 */ 3836 panelActiveClass: 'is-active' 3837}; 3838 3839 3840 3841/***/ }), 3842/* 15 */ 3843/***/ (function(module, __webpack_exports__, __webpack_require__) { 3844 3845"use strict"; 3846/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Positionable; }); 3847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_util_box__ = __webpack_require__(7); 3848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_plugin__ = __webpack_require__(2); 3849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(1); 3850 3851 3852var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 3853 3854function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3855 3856function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 3857 3858function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 3859 3860 3861 3862 3863 3864var POSITIONS = ['left', 'right', 'top', 'bottom']; 3865var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center']; 3866var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center']; 3867 3868var ALIGNMENTS = { 3869 'left': VERTICAL_ALIGNMENTS, 3870 'right': VERTICAL_ALIGNMENTS, 3871 'top': HORIZONTAL_ALIGNMENTS, 3872 'bottom': HORIZONTAL_ALIGNMENTS 3873}; 3874 3875function nextItem(item, array) { 3876 var currentIdx = array.indexOf(item); 3877 if (currentIdx === array.length - 1) { 3878 return array[0]; 3879 } else { 3880 return array[currentIdx + 1]; 3881 } 3882} 3883 3884var Positionable = function (_Plugin) { 3885 _inherits(Positionable, _Plugin); 3886 3887 function Positionable() { 3888 _classCallCheck(this, Positionable); 3889 3890 return _possibleConstructorReturn(this, (Positionable.__proto__ || Object.getPrototypeOf(Positionable)).apply(this, arguments)); 3891 } 3892 3893 _createClass(Positionable, [{ 3894 key: '_init', 3895 3896 /** 3897 * Abstract class encapsulating the tether-like explicit positioning logic 3898 * including repositioning based on overlap. 3899 * Expects classes to define defaults for vOffset, hOffset, position, 3900 * alignment, allowOverlap, and allowBottomOverlap. They can do this by 3901 * extending the defaults, or (for now recommended due to the way docs are 3902 * generated) by explicitly declaring them. 3903 * 3904 **/ 3905 3906 value: function _init() { 3907 this.triedPositions = {}; 3908 this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position; 3909 this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment; 3910 } 3911 }, { 3912 key: '_getDefaultPosition', 3913 value: function _getDefaultPosition() { 3914 return 'bottom'; 3915 } 3916 }, { 3917 key: '_getDefaultAlignment', 3918 value: function _getDefaultAlignment() { 3919 switch (this.position) { 3920 case 'bottom': 3921 case 'top': 3922 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["b" /* rtl */])() ? 'right' : 'left'; 3923 case 'left': 3924 case 'right': 3925 return 'bottom'; 3926 } 3927 } 3928 3929 /** 3930 * Adjusts the positionable possible positions by iterating through alignments 3931 * and positions. 3932 * @function 3933 * @private 3934 */ 3935 3936 }, { 3937 key: '_reposition', 3938 value: function _reposition() { 3939 if (this._alignmentsExhausted(this.position)) { 3940 this.position = nextItem(this.position, POSITIONS); 3941 this.alignment = ALIGNMENTS[this.position][0]; 3942 } else { 3943 this._realign(); 3944 } 3945 } 3946 3947 /** 3948 * Adjusts the dropdown pane possible positions by iterating through alignments 3949 * on the current position. 3950 * @function 3951 * @private 3952 */ 3953 3954 }, { 3955 key: '_realign', 3956 value: function _realign() { 3957 this._addTriedPosition(this.position, this.alignment); 3958 this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]); 3959 } 3960 }, { 3961 key: '_addTriedPosition', 3962 value: function _addTriedPosition(position, alignment) { 3963 this.triedPositions[position] = this.triedPositions[position] || []; 3964 this.triedPositions[position].push(alignment); 3965 } 3966 }, { 3967 key: '_positionsExhausted', 3968 value: function _positionsExhausted() { 3969 var isExhausted = true; 3970 for (var i = 0; i < POSITIONS.length; i++) { 3971 isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]); 3972 } 3973 return isExhausted; 3974 } 3975 }, { 3976 key: '_alignmentsExhausted', 3977 value: function _alignmentsExhausted(position) { 3978 return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length; 3979 } 3980 3981 // When we're trying to center, we don't want to apply offset that's going to 3982 // take us just off center, so wrap around to return 0 for the appropriate 3983 // offset in those alignments. TODO: Figure out if we want to make this 3984 // configurable behavior... it feels more intuitive, especially for tooltips, but 3985 // it's possible someone might actually want to start from center and then nudge 3986 // slightly off. 3987 3988 }, { 3989 key: '_getVOffset', 3990 value: function _getVOffset() { 3991 return this.options.vOffset; 3992 } 3993 }, { 3994 key: '_getHOffset', 3995 value: function _getHOffset() { 3996 return this.options.hOffset; 3997 } 3998 }, { 3999 key: '_setPosition', 4000 value: function _setPosition($anchor, $element, $parent) { 4001 if ($anchor.attr('aria-expanded') === 'false') { 4002 return false; 4003 } 4004 var $eleDims = __WEBPACK_IMPORTED_MODULE_0__foundation_util_box__["a" /* Box */].GetDimensions($element), 4005 $anchorDims = __WEBPACK_IMPORTED_MODULE_0__foundation_util_box__["a" /* Box */].GetDimensions($anchor); 4006 4007 $element.offset(__WEBPACK_IMPORTED_MODULE_0__foundation_util_box__["a" /* Box */].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 4008 4009 if (!this.options.allowOverlap) { 4010 var overlaps = {}; 4011 var minOverlap = 100000000; 4012 // default coordinates to how we start, in case we can't figure out better 4013 var minCoordinates = { position: this.position, alignment: this.alignment }; 4014 while (!this._positionsExhausted()) { 4015 var overlap = __WEBPACK_IMPORTED_MODULE_0__foundation_util_box__["a" /* Box */].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap); 4016 if (overlap === 0) { 4017 return; 4018 } 4019 4020 if (overlap < minOverlap) { 4021 minOverlap = overlap; 4022 minCoordinates = { position: this.position, alignment: this.alignment }; 4023 } 4024 4025 this._reposition(); 4026 4027 $element.offset(__WEBPACK_IMPORTED_MODULE_0__foundation_util_box__["a" /* Box */].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 4028 } 4029 // If we get through the entire loop, there was no non-overlapping 4030 // position available. Pick the version with least overlap. 4031 this.position = minCoordinates.position; 4032 this.alignment = minCoordinates.alignment; 4033 $element.offset(__WEBPACK_IMPORTED_MODULE_0__foundation_util_box__["a" /* Box */].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 4034 } 4035 } 4036 }]); 4037 4038 return Positionable; 4039}(__WEBPACK_IMPORTED_MODULE_1__foundation_plugin__["a" /* Plugin */]); 4040 4041Positionable.defaults = { 4042 /** 4043 * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto. 4044 * @option 4045 * @type {string} 4046 * @default 'auto' 4047 */ 4048 position: 'auto', 4049 /** 4050 * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto. 4051 * @option 4052 * @type {string} 4053 * @default 'auto' 4054 */ 4055 alignment: 'auto', 4056 /** 4057 * Allow overlap of container/window. If false, dropdown positionable first 4058 * try to position as defined by data-position and data-alignment, but 4059 * reposition if it would cause an overflow. 4060 * @option 4061 * @type {boolean} 4062 * @default false 4063 */ 4064 allowOverlap: false, 4065 /** 4066 * Allow overlap of only the bottom of the container. This is the most common 4067 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 4068 * screen but not otherwise influence or break out of the container. 4069 * @option 4070 * @type {boolean} 4071 * @default true 4072 */ 4073 allowBottomOverlap: true, 4074 /** 4075 * Number of pixels the positionable should be separated vertically from anch
4075or 4076 * @option 4077 * @type {number} 4078 * @default 0 4079 */ 4080 vOffset: 0, 4081 /** 4082 * Number of pixels the positionable should be separated horizontally from anchor 4083 * @option 4084 * @type {number} 4085 * @default 0 4086 */ 4087 hOffset: 0 4088}; 4089 4090 4091 4092/***/ }), 4093/* 16 */ 4094/***/ (function(module, __webpack_exports__, __webpack_require__) { 4095 4096"use strict"; 4097/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Touch; }); 4098/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 4099/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 4100var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 4101 4102function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4103 4104//************************************************** 4105//**Work inspired by multiple jquery swipe plugins** 4106//**Done by Yohai Ararat *************************** 4107//************************************************** 4108 4109 4110 4111var Touch = {}; 4112 4113var startPosX, 4114 startPosY, 4115 startTime, 4116 elapsedTime, 4117 isMoving = false; 4118 4119function onTouchEnd() { 4120 // alert(this); 4121 this.removeEventListener('touchmove', onTouchMove); 4122 this.removeEventListener('touchend', onTouchEnd); 4123 isMoving = false; 4124} 4125 4126function onTouchMove(e) { 4127 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.spotSwipe.preventDefault) { 4128 e.preventDefault(); 4129 } 4130 if (isMoving) { 4131 var x = e.touches[0].pageX; 4132 var y = e.touches[0].pageY; 4133 var dx = startPosX - x; 4134 var dy = startPosY - y; 4135 var dir; 4136 elapsedTime = new Date().getTime() - startTime; 4137 if (Math.abs(dx) >= __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.spotSwipe.moveThreshold && elapsedTime <= __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.spotSwipe.timeThreshold) { 4138 dir = dx > 0 ? 'left' : 'right'; 4139 } 4140 // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { 4141 // dir = dy > 0 ? 'down' : 'up'; 4142 // } 4143 if (dir) { 4144 e.preventDefault(); 4145 onTouchEnd.call(this); 4146 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('swipe', dir).trigger('swipe' + dir); 4147 } 4148 } 4149} 4150 4151function onTouchStart(e) { 4152 if (e.touches.length == 1) { 4153 startPosX = e.touches[0].pageX; 4154 startPosY = e.touches[0].pageY; 4155 isMoving = true; 4156 startTime = new Date().getTime(); 4157 this.addEventListener('touchmove', onTouchMove, false); 4158 this.addEventListener('touchend', onTouchEnd, false); 4159 } 4160} 4161 4162function init() { 4163 this.addEventListener && this.addEventListener('touchstart', onTouchStart, false); 4164} 4165 4166function teardown() { 4167 this.removeEventListener('touchstart', onTouchStart); 4168} 4169 4170var SpotSwipe = function () { 4171 function SpotSwipe($) { 4172 _classCallCheck(this, SpotSwipe); 4173 4174 this.version = '1.0.0'; 4175 this.enabled = 'ontouchstart' in document.documentElement; 4176 this.preventDefault = false; 4177 this.moveThreshold = 75; 4178 this.timeThreshold = 200; 4179 this.$ = $; 4180 this._init(); 4181 } 4182 4183 _createClass(SpotSwipe, [{ 4184 key: '_init', 4185 value: function _init() { 4186 var $ = this.$; 4187 $.event.special.swipe = { setup: init }; 4188 4189 $.each(['left', 'up', 'down', 'right'], function () { 4190 $.event.special['swipe' + this] = { setup: function () { 4191 $(this).on('swipe', $.noop); 4192 } }; 4193 }); 4194 } 4195 }]); 4196 4197 return SpotSwipe; 4198}();
4199 4200/**************************************************** 4201 * As far as I can tell, both setupSpotSwipe and * 4202 * setupTouchHandler should be idempotent, * 4203 * because they directly replace functions & * 4204 * values, and do not add event handlers directly. * 4205 ****************************************************/ 4206 4207Touch.setupSpotSwipe = function ($) { 4208 $.spotSwipe = new SpotSwipe($); 4209}; 4210 4211/**************************************************** 4212 * Method for adding pseudo drag events to elements * 4213 ***************************************************/ 4214Touch.setupTouchHandler = function ($) { 4215 $.fn.addTouch = function () { 4216 this.each(function (i, el) { 4217 $(el).bind('touchstart touchmove touchend touchcancel', function () { 4218 //we pass the original event object because the jQuery event 4219 //object is normalized to w3c specs and does not provide the TouchList 4220 handleTouch(event); 4221 }); 4222 }); 4223 4224 var handleTouch = function (event) { 4225 var touches = event.changedTouches, 4226 first = touches[0], 4227 eventTypes = { 4228 touchstart: 'mousedown', 4229 touchmove: 'mousemove', 4230 touchend: 'mouseup' 4231 }, 4232 type = eventTypes[event.type], 4233 simulatedEvent; 4234 4235 if ('MouseEvent' in window && typeof window.MouseEvent === 'function') { 4236 simulatedEvent = new window.MouseEvent(type, { 4237 'bubbles': true, 4238 'cancelable': true, 4239 'screenX': first.screenX, 4240 'screenY': first.screenY, 4241 'clientX': first.clientX, 4242 'clientY': first.clientY 4243 }); 4244 } else { 4245 simulatedEvent = document.createEvent('MouseEvent'); 4246 simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 /*left*/, null); 4247 } 4248 first.target.dispatchEvent(simulatedEvent); 4249 }; 4250 }; 4251}; 4252 4253Touch.init = function ($) { 4254 if (typeof $.spotSwipe === 'undefined') { 4255 Touch.setupSpotSwipe($); 4256 Touch.setupTouchHandler($); 4257 } 4258}; 4259 4260 4261 4262/***/ }), 4263/* 17 */ 4264/***/ (function(module, __webpack_exports__, __webpack_require__) { 4265 4266"use strict"; 4267/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Abide; }); 4268/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 4269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 4270/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_plugin__ = __webpack_require__(2); 4271 4272 4273var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 4274 4275function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4276 4277function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 4278 4279function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 4280 4281 4282 4283 4284/** 4285 * Abide module. 4286 * @module foundation.abide 4287 */ 4288 4289var Abide = function (_Plugin) { 4290 _inherits(Abide, _Plugin); 4291 4292 function Abide() { 4293 _classCallCheck(this, Abide); 4294 4295 return _possibleConstructorReturn(this, (Abide.__proto__ || Object.getPrototypeOf(Abide)).apply(this, arguments)); 4296 } 4297 4298 _createClass(Abide, [{ 4299 key: '_setup', 4300 4301 /** 4302 * Creates a new instance of Abide. 4303 * @class 4304 * @name Abide 4305 * @fires Abide#init 4306 * @param {Object} element - jQuery object to add the trigger to. 4307 * @param {Object} options - Overrides to the default plugin settings. 4308 */ 4309 value: function _setup(element) { 4310 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 4311 4312 this.$element = element; 4313 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options); 4314 4315 this.className = 'Abide'; // ie9 back compat 4316 this._init(); 4317 } 4318 4319 /** 4320 * Initializes the Abide plugin and calls functions to get Abide functioning on load. 4321 * @private 4322 */ 4323 4324 }, { 4325 key: '_init', 4326 value: function _init() { 4327 this.$inputs = this.$element.find('input, textarea, select'); 4328 4329 this._events(); 4330 } 4331 4332 /** 4333 * Initializes events for Abide. 4334 * @private 4335 */ 4336 4337 }, { 4338 key: '_events', 4339 value: function _events() { 4340 var _this3 = this; 4341 4342 this.$element.off('.abide').on('reset.zf.abide', function () { 4343 _this3.resetForm(); 4344 }).on('submit.zf.abide', function () { 4345 return _this3.validateForm(); 4346 }); 4347 4348 if (this.options.validateOn === 'fieldChange') { 4349 this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) { 4350 _this3.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target)); 4351 }); 4352 } 4353 4354 if (this.options.liveValidate) { 4355 this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) { 4356 _this3.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target)); 4357 }); 4358 } 4359 4360 if (this.options.validateOnBlur) { 4361 this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) { 4362 _this3.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target)); 4363 }); 4364 } 4365 } 4366 4367 /** 4368 * Calls necessary functions to update Abide upon DOM change 4369 * @private 4370 */ 4371 4372 }, { 4373 key: '_reflow', 4374 value: function _reflow() { 4375 this._init(); 4376 } 4377 4378 /** 4379 * Checks whether or not a form element has the required attribute and if it's checked or not 4380 * @param {Object} element - jQuery object to check for required attribute 4381 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 4382 */ 4383 4384 }, { 4385 key: 'requiredCheck', 4386 value: function requiredCheck($el) { 4387 if (!$el.attr('required')) return true; 4388 4389 var isGood = true; 4390 4391 switch ($el[0].type) { 4392 case 'checkbox': 4393 isGood = $el[0].checked; 4394 break; 4395 4396 case 'select': 4397 case 'select-one': 4398 case 'select-multiple': 4399 var opt = $el.find('option:selected'); 4400 if (!opt.length || !opt.val()) isGood = false; 4401 break; 4402 4403 default: 4404 if (!$el.val() || !$el.val().length) isGood = false; 4405 } 4406 4407 return isGood; 4408 } 4409 4410 /** 4411 * Get:
4412 * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order: 4413 * 1. The element's direct sibling('s). 4414 * 2. The element's parent's children. 4415 * - Element(s) with the attribute `[data-form-error-for]` set with the element's id. 4416 * 4417 * This allows for multiple form errors per input, though if none are found, no form errors will be shown. 4418 * 4419 * @param {Object} $el - jQuery object to use as reference to find the form error selector. 4420 * @returns {Object} jQuery object with the selector. 4421 */ 4422 4423 }, { 4424 key: 'findFormError', 4425 value: function findFormError($el) { 4426 var id = $el[0].id; 4427 var $error = $el.siblings(this.options.formErrorSelector); 4428 4429 if (!$error.length) { 4430 $error = $el.parent().find(this.options.formErrorSelector); 4431 } 4432 4433 $error = $error.add(this.$element.find('[data-form-error-for="' + id + '"]')); 4434 4435 return $error; 4436 } 4437 4438 /** 4439 * Get the first element in this order: 4440 * 2. The <label> with the attribute `[for="someInputId"]` 4441 * 3. The `.closest()` <label> 4442 * 4443 * @param {Object} $el - jQuery object to check for required attribute 4444 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 4445 */ 4446 4447 }, { 4448 key: 'findLabel', 4449 value: function findLabel($el) { 4450 var id = $el[0].id; 4451 var $label = this.$element.find('label[for="' + id + '"]'); 4452 4453 if (!$label.length) { 4454 return $el.closest('label'); 4455 } 4456 4457 return $label; 4458 } 4459 4460 /** 4461 * Get the set of labels associated with a set of radio els in this order 4462 * 2. The <label> with the attribute `[for="someInputId"]` 4463 * 3. The `.closest()` <label> 4464 * 4465 * @param {Object} $el - jQuery object to check for required attribute 4466 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 4467 */ 4468 4469 }, { 4470 key: 'findRadioLabels', 4471 value: function findRadioLabels($els) { 4472 var _this4 = this; 4473 4474 var labels = $els.map(function (i, el) { 4475 var id = el.id; 4476 var $label = _this4.$element.find('label[for="' + id + '"]'); 4477 4478 if (!$label.length) { 4479 $label = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el).closest('label'); 4480 } 4481 return $label[0]; 4482 }); 4483 4484 return __WEBPACK_IMPORTED_MODULE_0_jquery___default()(labels); 4485 } 4486 4487 /** 4488 * Adds the CSS error class as specified by the Abide settings to the label, input, and the form 4489 * @param {Object} $el - jQuery object to add the class to 4490 */ 4491 4492 }, { 4493 key: 'addErrorClasses', 4494 value: function addErrorClasses($el) { 4495 var $label = this.findLabel($el); 4496 var $formError = this.findFormError($el); 4497 4498 if ($label.length) { 4499 $label.addClass(this.options.labelErrorClass); 4500 } 4501 4502 if ($formError.length) { 4503 $formError.addClass(this.options.formErrorClass); 4504 } 4505 4506 $el.addClass(this.options.inputErrorClass).attr('data-invalid', ''); 4507 } 4508 4509 /** 4510 * Remove CSS error classes etc from an entire radio button group 4511 * @param {String} groupName - A string that specifies the name of a radio button group 4512 * 4513 */ 4514 4515 }, { 4516 key: 'removeRadioErrorClasses', 4517 value: function removeRadioErrorClasses(groupName) { 4518 var $els = this.$element.find(':radio[name="' + groupName + '"]'); 4519 var $labels = this.findRadioLabels($els); 4520 var $formErrors = this.findFormError($els); 4521 4522 if ($labels.length) { 4523 $labels.removeClass(this.options.labelErrorClass); 4524 } 4525 4526 if ($formErrors.length) { 4527 $formErrors.removeClass(this.options.formErrorClass); 4528 } 4529 4530 $els.removeClass(this.options.inputErrorClass).removeAttr('data-invalid'); 4531 } 4532 4533 /** 4534 * Removes CSS error class as specified by the Abide settings from the label, input, and the form 4535 * @param {Object} $el - jQuery object to remove the class from 4536 */ 4537 4538 }, { 4539 key: 'removeErrorClasses', 4540 value: function removeErrorClasses($el) { 4541 // radios need to clear all of the els 4542 if ($el[0].type == 'radio') { 4543 return this.removeRadioErrorClasses($el.attr('name')); 4544 } 4545 4546 var $label = this.findLabel($el); 4547 var $formError = this.findFormError($el); 4548 4549 if ($label.length) { 4550 $label.removeClass(this.options.labelErrorClass); 4551 } 4552 4553 if ($formError.length) { 4554 $formError.removeClass(this.options.formErrorClass); 4555 } 4556 4557 $el.removeClass(this.options.inputErrorClass).removeAttr('data-invalid'); 4558 } 4559 4560 /** 4561 * Goes through a form to find inputs and proceeds to validate them in ways specific to their type. 4562 * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set 4563 * @fires Abide#invalid 4564 * @fires Abide#valid 4565 * @param {Object} element - jQuery object to validate, should be an HTML input 4566 * @returns {Boolean} goodToGo - If the input is valid or not. 4567 */ 4568 4569 }, { 4570 key: 'validateInput', 4571 value: function validateInput($el) { 4572 var _this5 = this; 4573 4574 var clearRequire = this.requiredCheck($el), 4575 validated = false, 4576 customValidator = true, 4577 validator = $el.attr('data-validator'), 4578 equalTo = true; 4579
4580 // don't validate ignored inputs or hidden inputs or disabled inputs 4581 if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) { 4582 return true; 4583 } 4584 4585 switch ($el[0].type) { 4586 case 'radio': 4587 validated = this.validateRadio($el.attr('name')); 4588 break; 4589 4590 case 'checkbox': 4591 validated = clearRequire; 4592 break; 4593 4594 case 'select': 4595 case 'select-one': 4596 case 'select-multiple': 4597 validated = clearRequire; 4598 break; 4599 4600 default: 4601 validated = this.validateText($el); 4602 } 4603 4604 if (validator) { 4605 customValidator = this.matchValidation($el, validator, $el.attr('required')); 4606 } 4607 4608 if ($el.attr('data-equalto')) { 4609 equalTo = this.options.validators.equalTo($el); 4610 } 4611 4612 var goodToGo = [clearRequire, validated, customValidator, equalTo].indexOf(false) === -1; 4613 var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide'; 4614 4615 if (goodToGo) { 4616 // Re-validate inputs that depend on this one with equalto 4617 var dependentElements = this.$element.find('[data-equalto="' + $el.attr('id') + '"]'); 4618 if (dependentElements.length) { 4619 (function () { 4620 var _this = _this5; 4621 dependentElements.each(function () { 4622 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).val()) { 4623 _this.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)); 4624 } 4625 }); 4626 })(); 4627 } 4628 } 4629 4630 this[goodToGo ? 'removeErrorClasses' : 'addErrorClasses']($el); 4631 4632 /** 4633 * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide` 4634 * Trigger includes the DOM element of the input. 4635 * @event Abide#valid 4636 * @event Abide#invalid 4637 */ 4638 $el.trigger(message, [$el]); 4639 4640 return goodToGo; 4641 } 4642 4643 /** 4644 * Goes through a form and if there are any invalid inputs, it will display the form error element 4645 * @returns {Boolean} noError - true if no errors were detected... 4646 * @fires Abide#formvalid 4647 * @fires Abide#forminvalid 4648 */ 4649 4650 }, { 4651 key: 'validateForm', 4652 value: function validateForm() { 4653 var acc = []; 4654 var _this = this; 4655 4656 this.$inputs.each(function () { 4657 acc.push(_this.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this))); 4658 }); 4659 4660 var noError = acc.indexOf(false) === -1; 4661 4662 this.$element.find('[data-abide-error]').css('display', noError ? 'none' : 'block'); 4663 4664 /** 4665 * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`. 4666 * Trigger includes the element of the form. 4667 * @event Abide#formvalid 4668 * @event Abide#forminvalid 4669 */ 4670 this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]); 4671 4672 return noError; 4673 } 4674 4675 /** 4676 * Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true. 4677 * @param {Object} $el - jQuery object to validate, should be a text input HTML element 4678 * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns 4679 * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified 4680 */ 4681 4682 }, { 4683 key: 'validateText', 4684 value: function validateText($el, pattern) { 4685 // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute 4686 pattern = pattern || $el.attr('pattern') || $el.attr('type'); 4687 var inputText = $el.val(); 4688 var valid = false; 4689 4690 if (inputText.length) { 4691 // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp 4692 if (this.options.patterns.hasOwnProperty(pattern)) { 4693 valid = this.options.patterns[pattern].test(inputText); 4694 } 4695 // If the pattern name isn't also the type attribute of the field, then test it as a regexp 4696 else if (pattern !== $el.attr('type')) { 4697 valid = new RegExp(pattern).test(inputText); 4698 } else { 4699 valid = true; 4700 } 4701 } 4702 // An empty field is valid if it's not required 4703 else if (!$el.prop('required')) { 4704 valid = true; 4705 } 4706 4707 return valid; 4708 } 4709 4710 /** 4711 * Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group. 4712 * @param {String} groupName - A string that specifies the name of a radio button group 4713 * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required) 4714 */ 4715 4716 }, { 4717 key: 'validateRadio', 4718 value: function validateRadio(groupName) { 4719 // If at least one radio in the group has the `required` attribute, the group is considered required 4720 // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice 4721 var $group = this.$element.find(':radio[name="' + groupName + '"]');
4722 var valid = false, 4723 required = false; 4724 4725 // For the group to be required, at least one radio needs to be required 4726 $group.each(function (i, e) { 4727 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e).attr('required')) { 4728 required = true; 4729 } 4730 }); 4731 if (!required) valid = true; 4732 4733 if (!valid) { 4734 // For the group to be valid, at least one radio needs to be checked 4735 $group.each(function (i, e) { 4736 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e).prop('checked')) { 4737 valid = true; 4738 } 4739 }); 4740 }; 4741 4742 return valid; 4743 } 4744 4745 /** 4746 * Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator="foo bar baz"` in a space separated listed. 4747 * @param {Object} $el - jQuery input element. 4748 * @param {String} validators - a string of function names matching functions in the Abide.options.validators object. 4749 * @param {Boolean} required - self explanatory? 4750 * @returns {Boolean} - true if validations passed. 4751 */ 4752 4753 }, { 4754 key: 'matchValidation', 4755 value: function matchValidation($el, validators, required) { 4756 var _this6 = this; 4757 4758 required = required ? true : false; 4759 4760 var clear = validators.split(' ').map(function (v) { 4761 return _this6.options.validators[v]($el, required, $el.parent()); 4762 }); 4763 return clear.indexOf(false) === -1; 4764 } 4765 4766 /** 4767 * Resets form inputs and styles 4768 * @fires Abide#formreset 4769 */ 4770 4771 }, { 4772 key: 'resetForm', 4773 value: function resetForm() { 4774 var $form = this.$element, 4775 opts = this.options; 4776 4777 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.' + opts.labelErrorClass, $form).not('small').removeClass(opts.labelErrorClass); 4778 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.' + opts.inputErrorClass, $form).not('small').removeClass(opts.inputErrorClass); 4779 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(opts.formErrorSelector + '.' + opts.formErrorClass).removeClass(opts.formErrorClass); 4780 $form.find('[data-abide-error]').css('display', 'none'); 4781 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').removeAttr('data-invalid'); 4782 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).removeAttr('data-invalid'); 4783 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).removeAttr('data-invalid'); 4784 /** 4785 * Fires when the form has been reset. 4786 * @event Abide#formreset 4787 */ 4788 $form.trigger('formreset.zf.abide', [$form]); 4789 } 4790 4791 /** 4792 * Destroys an instance of Abide. 4793 * Removes error styles and classes from elements, without resetting their values. 4794 */ 4795 4796 }, { 4797 key: '_destroy', 4798 value: function _destroy() { 4799 var _this = this; 4800 this.$element.off('.abide').find('[data-abide-error]').css('display', 'none'); 4801 4802 this.$inputs.off('.abide').each(function () { 4803 _this.removeErrorClasses(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)); 4804 }); 4805 } 4806 }]); 4807 4808 return Abide; 4809}(__WEBPACK_IMPORTED_MODULE_1__foundation_plugin__["a" /* Plugin */]); 4810 4811/** 4812 * Default settings for plugin 4813 */ 4814 4815 4816Abide.defaults = { 4817 /** 4818 * The default event to validate inputs. Checkboxes and radios validate immediately. 4819 * Remove or change this value for manual validation. 4820 * @option 4821 * @type {?string} 4822 * @default 'fieldChange' 4823 */ 4824 validateOn: 'fieldChange', 4825 4826 /** 4827 * Class to be applied to input labels on failed validation. 4828 * @option 4829 * @type {string} 4830 * @default 'is-invalid-label' 4831 */ 4832 labelErrorClass: 'is-invalid-label', 4833 4834 /** 4835 * Class to be applied to inputs on failed validation. 4836 * @option 4837 * @type {string} 4838 * @default 'is-invalid-input' 4839 */ 4840 inputErrorClass: 'is-invalid-input', 4841 4842 /** 4843 * Class selector to use to target Form Errors for show/hide. 4844 * @option 4845 * @type {string} 4846 * @default '.form-error' 4847 */ 4848 formErrorSelector: '.form-error', 4849 4850 /** 4851 * Class added to Form Errors on failed validation. 4852 * @option 4853 * @type {string} 4854 * @default 'is-visible' 4855 */ 4856 formErrorClass: 'is-visible', 4857 4858 /** 4859 * Set to true to validate text inputs on any value change. 4860 * @option 4861 * @type {boolean} 4862 * @default false 4863 */ 4864 liveValidate: false, 4865 4866 /** 4867 * Set to true to validate inputs on blur. 4868 * @option 4869 * @type {boolean} 4870 * @default false 4871 */ 4872 validateOnBlur: false, 4873 4874 patterns: {
4875 alpha: /^[a-zA-Z]+$/, 4876 alpha_numeric: /^[a-zA-Z0-9]+$/, 4877 integer: /^[-+]?\d+$/, 4878 number: /^[-+]?\d*(?:[\.\,]\d+)?$/, 4879 4880 // amex, visa, diners 4881 card: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/, 4882 cvv: /^([0-9]){3,4}$/, 4883 4884 // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 4885 email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/, 4886 4887 url: /^(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/, 4888 // abc.de 4889 domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/, 4890 4891 datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/, 4892 // YYYY-MM-DD 4893 date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/, 4894 // HH:MM:SS 4895 time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/, 4896 dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/, 4897 // MM/DD/YYYY 4898 month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/, 4899 // DD/MM/YYYY 4900 day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/, 4901 4902 // #FFF or #FFFFFF 4903 color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, 4904 4905 // Domain || URL 4906 website: { 4907 test: function (text) { 4908 return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text); 4909 } 4910 } 4911 }, 4912 4913 /** 4914 * Optional validation functions to be used. `equalTo` being the only default included function. 4915 * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments: 4916 * el : The jQuery element to validate. 4917 * required : Boolean value of the required attribute be present or not. 4918 * parent : The direct parent of the input. 4919 * @option 4920 */ 4921 validators: { 4922 equalTo: function (el, required, parent) { 4923 return __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + el.attr('data-equalto')).val() === el.val(); 4924 } 4925 } 4926}; 4927 4928 4929 4930/***/ }), 4931/* 18 */ 4932/***/ (function(module, __webpack_exports__, __webpack_require__) { 4933 4934"use strict"; 4935/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Foundation; }); 4936/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 4937/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 4938/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 4939/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(3); 4940 4941 4942 4943 4944 4945 4946var FOUNDATION_VERSION = '6.4.2'; 4947 4948// Global Foundation object 4949// This is attached to the window, or used as a module for AMD/Browserify 4950var Foundation = { 4951 version: FOUNDATION_VERSION, 4952 4953 /** 4954 * Stores initialized plugins. 4955 */ 4956 _plugins: {}, 4957 4958 /** 4959 * Stores generated unique ids for plugin instances 4960 */ 4961 _uuids: [], 4962 4963 /** 4964 * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing. 4965 * @param {Object} plugin - The constructor of the plugin. 4966 */ 4967 plugin: function (plugin, name) { 4968 // Object key to use when adding to global Foundation object 4969 // Examples: Foundation.Reveal, Foundation.OffCanvas 4970 var className = name || functionName(plugin); 4971 // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin 4972 // Examples: data-reveal, data-off-canvas 4973 var attrName = hyphenate(className); 4974 4975 // Add to the Foundation object and the plugins list (for reflowing) 4976 this._plugins[attrName] = this[className] = plugin; 4977 }, 4978 /** 4979 * @function 4980 * Populates the _uuids array with pointers to each individual plugin instance. 4981 * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls. 4982 * Also fires the initialization event for each plugin, consolidating repetitive code. 4983 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 4984 * @param {String} name - the name of the plugin, passed as a camelCased string. 4985 * @fires Plugin#init 4986 */ 4987 registerPlugin: function (plugin, name) { 4988 var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase(); 4989 plugin.uuid = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["a" /* GetYoDigits */])(6, pluginName); 4990 4991 if (!plugin.$element.attr('data-' + pluginName)) { 4992 plugin.$element.attr('data-' + pluginName, plugin.uuid); 4993 } 4994 if (!plugin.$element.data('zfPlugin')) { 4995 plugin.$element.data('zfPlugin', plugin); 4996 } 4997 /** 4998 * Fires when the plugin has initialized. 4999 * @event Plugin#init 5000 */ 5001 plugin.$element.trigger('init.zf.' + pluginName); 5002 5003 this._uuids.push(plugin.uuid); 5004 5005 return; 5006 }, 5007 /** 5008 * @function 5009 * Removes the plugins uuid from the _uuids array. 5010 * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute. 5011 * Also fires the destroyed event for the plugin, consolidating repetitive code. 5012 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 5013 * @fires Plugin#destroyed 5014 */ 5015 unregisterPlugin: function (plugin) { 5016 var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor)); 5017 5018 this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1); 5019 plugin.$element.removeAttr('data-' + pluginName).removeData('zfPlugin') 5020 /** 5021 * Fires when the plugin has been destroyed. 5022 * @event Plugin#destroyed 5023 */ 5024 .trigger('destroyed.zf.' + pluginName); 5025 for (var prop in plugin) { 5026 plugin[prop] = null; //clean up script to prep for garbage collection. 5027 } 5028 return; 5029 }, 5030 5031 /** 5032 * @function 5033 * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc. 5034 * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'` 5035 * @default If no argument is passed, reflow all currently active plugins. 5036 */ 5037 reInit: function (plugins) { 5038 var isJQ = plugins instanceof __WEBPACK_IMPORTED_MODULE_0_jquery___default.a; 5039 try { 5040 if (isJQ) { 5041 plugins.each(function () { 5042 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('zfPlugin')._init(); 5043 }); 5044 } else { 5045 var type = typeof plugins, 5046 _this = this, 5047 fns = { 5048 'object': function (plgs) {
5049 plgs.forEach(function (p) { 5050 p = hyphenate(p); 5051 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + p + ']').foundation('_init'); 5052 }); 5053 }, 5054 'string': function () { 5055 plugins = hyphenate(plugins); 5056 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + plugins + ']').foundation('_init'); 5057 }, 5058 'undefined': function () { 5059 this['object'](Object.keys(_this._plugins)); 5060 } 5061 }; 5062 fns[type](plugins); 5063 } 5064 } catch (err) { 5065 console.error(err); 5066 } finally { 5067 return plugins; 5068 } 5069 }, 5070 5071 /** 5072 * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized. 5073 * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object. 5074 * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything. 5075 */ 5076 reflow: function (elem, plugins) { 5077 5078 // If plugins is undefined, just grab everything 5079 if (typeof plugins === 'undefined') { 5080 plugins = Object.keys(this._plugins); 5081 } 5082 // If plugins is a string, convert it to an array with one item 5083 else if (typeof plugins === 'string') { 5084 plugins = [plugins]; 5085 } 5086 5087 var _this = this; 5088 5089 // Iterate through each plugin 5090 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(plugins, function (i, name) { 5091 // Get the current plugin 5092 var plugin = _this._plugins[name]; 5093 5094 // Localize the search to all elements inside elem, as well as elem itself, unless elem === document 5095 var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']'); 5096 5097 // For each plugin found, initialize it 5098 $elem.each(function () { 5099 var $el = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 5100 opts = {}; 5101 // Don't double-dip on plugins 5102 if ($el.data('zfPlugin')) { 5103 console.warn("Tried to initialize " + name + " on an element that already has a Foundation plugin."); 5104 return; 5105 } 5106 5107 if ($el.attr('data-options')) { 5108 var thing = $el.attr('data-options').split(';').forEach(function (e, i) { 5109 var opt = e.split(':').map(function (el) { 5110 return el.trim(); 5111 }); 5112 if (opt[0]) opts[opt[0]] = parseValue(opt[1]); 5113 }); 5114 } 5115 try { 5116 $el.data('zfPlugin', new plugin(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), opts)); 5117 } catch (er) { 5118 console.error(er); 5119 } finally { 5120 return; 5121 } 5122 }); 5123 }); 5124 }, 5125 getFnName: functionName, 5126 5127 addToJquery: function ($) { 5128 // TODO: consider not making this a jQuery function 5129 // TODO: need way to reflow vs. re-initialize 5130 /** 5131 * The Foundation jQuery method. 5132 * @param {String|Array} method - An action to perform on the current jQuery object. 5133 */ 5134 var foundation = function (method) { 5135 var type = typeof method, 5136 $noJS = $('.no-js'); 5137 5138 if ($noJS.length) { 5139 $noJS.removeClass('no-js'); 5140 } 5141 5142 if (type === 'undefined') { 5143 //needs to initialize the Foundation object, or an individual plugin. 5144 __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 5145 Foundation.reflow(this); 5146 } else if (type === 'string') { 5147 //an individual method to invoke on a plugin or group of plugins 5148 var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary 5149 var plugClass = this.data('zfPlugin'); //determine the class of plugin 5150 5151 if (plugClass !== undefined && plugClass[method] !== undefined) { 5152 //make sure both the class and method exist 5153 if (this.length === 1) { 5154 //if there's only one, call it directly.
5155 plugClass[method].apply(plugClass, args); 5156 } else { 5157 this.each(function (i, el) { 5158 //otherwise loop through the jQuery collection and invoke the method on each 5159 plugClass[method].apply($(el).data('zfPlugin'), args); 5160 }); 5161 } 5162 } else { 5163 //error for no class or no method 5164 throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.'); 5165 } 5166 } else { 5167 //error for invalid argument type 5168 throw new TypeError('We\'re sorry, ' + type + ' is not a valid parameter. You must use a string representing the method you wish to invoke.'); 5169 } 5170 return this; 5171 }; 5172 $.fn.foundation = foundation; 5173 return $; 5174 } 5175}; 5176 5177Foundation.util = { 5178 /** 5179 * Function for applying a debounce effect to a function call. 5180 * @function 5181 * @param {Function} func - Function to be called at end of timeout. 5182 * @param {Number} delay - Time in ms to delay the call of `func`. 5183 * @returns function 5184 */ 5185 throttle: function (func, delay) { 5186 var timer = null; 5187 5188 return function () { 5189 var context = this, 5190 args = arguments; 5191 5192 if (timer === null) { 5193 timer = setTimeout(function () { 5194 func.apply(context, args); 5195 timer = null; 5196 }, delay); 5197 } 5198 }; 5199 } 5200}; 5201 5202window.Foundation = Foundation; 5203 5204// Polyfill for requestAnimationFrame 5205(function () { 5206 if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () { 5207 return new Date().getTime(); 5208 }; 5209 5210 var vendors = ['webkit', 'moz']; 5211 for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { 5212 var vp = vendors[i]; 5213 window.requestAnimationFrame = window[vp + 'RequestAnimationFrame']; 5214 window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame']; 5215 } 5216 if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) { 5217 var lastTime = 0; 5218 window.requestAnimationFrame = function (callback) { 5219 var now = Date.now(); 5220 var nextTime = Math.max(lastTime + 16, now); 5221 return setTimeout(function () { 5222 callback(lastTime = nextTime); 5223 }, nextTime - now); 5224 }; 5225 window.cancelAnimationFrame = clearTimeout; 5226 } 5227 /** 5228 * Polyfill for performance.now, required by rAF 5229 */ 5230 if (!window.performance || !window.performance.now) { 5231 window.performance = { 5232 start: Date.now(), 5233 now: function () { 5234 return Date.now() - this.start; 5235 } 5236 }; 5237 } 5238})(); 5239if (!Function.prototype.bind) { 5240 Function.prototype.bind = function (oThis) { 5241 if (typeof this !== 'function') { 5242 // closest thing possible to the ECMAScript 5 5243 // internal IsCallable function 5244 throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); 5245 } 5246 5247 var aArgs = Array.prototype.slice.call(arguments, 1), 5248 fToBind = this, 5249 fNOP = function () {}, 5250 fBound = function () { 5251 return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); 5252 }; 5253 5254 if (this.prototype) { 5255 // native functions don't have a prototype 5256 fNOP.prototype = this.prototype; 5257 } 5258 fBound.prototype = new fNOP(); 5259 5260 return fBound; 5261 }; 5262} 5263// Polyfill to get the name of a function in IE9 5264function functionName(fn) { 5265 if (Function.prototype.name === undefined) { 5266 var funcNameRegex = /function\s([^(]{1,})\(/; 5267 var results = funcNameRegex.exec(fn.toString()); 5268 return results && results.length > 1 ? results[1].trim() : ""; 5269 } else if (fn.prototype === undefined) { 5270 return fn.constructor.name; 5271 } else { 5272 return fn.prototype.constructor.name; 5273 } 5274} 5275function parseValue(str) { 5276 if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str); 5277 return str; 5278} 5279// Convert PascalCase to kebab-case 5280// Thank you: http://stackoverflow.com/a/8955580 5281function hyphenate(str) { 5282 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 5283} 5284 5285 5286 5287/***/ }), 5288/* 19 */ 5289/***/ (function(module, __webpack_exports__, __webpack_require__) { 5290 5291"use strict"; 5292/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Dropdown; }); 5293/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 5294/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 5295/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 5296/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(1); 5297/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_positionable__ = __webpack_require__(15); 5298/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_triggers__ = __webpack_require__(5); 5299 5300 5301var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 5302 5303var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; 5304 5305function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5306 5307function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 5308 5309function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
5309onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 5310 5311 5312 5313 5314 5315 5316 5317 5318/** 5319 * Dropdown module. 5320 * @module foundation.dropdown 5321 * @requires foundation.util.keyboard 5322 * @requires foundation.util.box 5323 * @requires foundation.util.triggers 5324 */ 5325 5326var Dropdown = function (_Positionable) { 5327 _inherits(Dropdown, _Positionable); 5328 5329 function Dropdown() { 5330 _classCallCheck(this, Dropdown); 5331 5332 return _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).apply(this, arguments)); 5333 } 5334 5335 _createClass(Dropdown, [{ 5336 key: '_setup', 5337 5338 /** 5339 * Creates a new instance of a dropdown. 5340 * @class 5341 * @name Dropdown 5342 * @param {jQuery} element - jQuery object to make into a dropdown. 5343 * Object should be of the dropdown panel, rather than its anchor. 5344 * @param {Object} options - Overrides to the default plugin settings. 5345 */ 5346 value: function _setup(element, options) { 5347 this.$element = element; 5348 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Dropdown.defaults, this.$element.data(), options); 5349 this.className = 'Dropdown'; // ie9 back compat 5350 5351 // Triggers init is idempotent, just need to make sure it is initialized 5352 __WEBPACK_IMPORTED_MODULE_4__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 5353 5354 this._init(); 5355 5356 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Dropdown', { 5357 'ENTER': 'open', 5358 'SPACE': 'open', 5359 'ESCAPE': 'close' 5360 }); 5361 } 5362 5363 /** 5364 * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. 5365 * @function 5366 * @private 5367 */ 5368 5369 }, { 5370 key: '_init', 5371 value: function _init() { 5372 var $id = this.$element.attr('id'); 5373 5374 this.$anchors = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-toggle="' + $id + '"]').length ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-toggle="' + $id + '"]') : __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-open="' + $id + '"]'); 5375 this.$anchors.attr({ 5376 'aria-controls': $id, 5377 'data-is-focus': false, 5378 'data-yeti-box': $id, 5379 'aria-haspopup': true, 5380 'aria-expanded': false 5381 }); 5382 5383 this._setCurrentAnchor(this.$anchors.first()); 5384 5385 if (this.options.parentClass) { 5386 this.$parent = this.$element.parents('.' + this.options.parentClass); 5387 } else { 5388 this.$parent = null; 5389 } 5390 5391 this.$element.attr({ 5392 'aria-hidden': 'true', 5393 'data-yeti-box': $id, 5394 'data-resize': $id, 5395 'aria-labelledby': this.$currentAnchor.id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["a" /* GetYoDigits */])(6, 'dd-anchor') 5396 }); 5397 _get(Dropdown.prototype.__proto__ || Object.getPrototypeOf(Dropdown.prototype), '_init', this).call(this); 5398 this._events(); 5399 } 5400 }, { 5401 key: '_getDefaultPosition', 5402 value: function _getDefaultPosition() { 5403 // handle legacy classnames 5404 var position = this.$element[0].className.match(/(top|left|right|bottom)/g); 5405 if (position) { 5406 return position[0]; 5407 } else { 5408 return 'bottom'; 5409 } 5410 } 5411 }, { 5412 key: '_getDefaultAlignment', 5413 value: function _getDefaultAlignment() { 5414 // handle legacy float approach 5415 var horizontalPosition = /float-(\S+)/.exec(this.$currentAnchor.className); 5416 if (horizontalPosition) { 5417 return horizontalPosition[1]; 5418 } 5419 5420 return _get(Dropdown.prototype.__proto__ || Object.getPrototypeOf(Dropdown.prototype), '_getDefaultAlignment', this).call(this); 5421 } 5422 5423 /** 5424 * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true. 5425 * Recursively calls itself if a collision is detected, with a new position class. 5426 * @function 5427 * @private 5428 */ 5429 5430 }, { 5431 key: '_setPosition', 5432 value: function _setPosition() { 5433 _get(Dropdown.prototype.__proto__ || Object.getPrototypeOf(Dropdown.prototype), '_setPosition', this).call(this, this.$currentAnchor, this.$element, this.$parent); 5434 } 5435 5436 /** 5437 * Make it a current anchor. 5438 * Current anchor as the reference for the position of Dropdown panes. 5439 * @param {HTML}
vendor: 4,324 bytes, lines 5439-5562
5439 el - DOM element of the anchor. 5440 * @function 5441 * @private 5442 */ 5443 5444 }, { 5445 key: '_setCurrentAnchor', 5446 value: function _setCurrentAnchor(el) { 5447 this.$currentAnchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el); 5448 } 5449 5450 /** 5451 * Adds event listeners to the element utilizing the triggers utility library. 5452 * @function 5453 * @private 5454 */ 5455 5456 }, { 5457 key: '_events', 5458 value: function _events() { 5459 var _this = this; 5460 this.$element.on({ 5461 'open.zf.trigger': this.open.bind(this), 5462 'close.zf.trigger': this.close.bind(this), 5463 'toggle.zf.trigger': this.toggle.bind(this), 5464 'resizeme.zf.trigger': this._setPosition.bind(this) 5465 }); 5466 5467 this.$anchors.off('click.zf.trigger').on('click.zf.trigger', function () { 5468 _this._setCurrentAnchor(this); 5469 }); 5470 5471 if (this.options.hover) { 5472 this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 5473 _this._setCurrentAnchor(this); 5474 5475 var bodyData = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').data(); 5476 if (typeof bodyData.whatinput === 'undefined' || bodyData.whatinput === 'mouse') { 5477 clearTimeout(_this.timeout); 5478 _this.timeout = setTimeout(function () { 5479 _this.open(); 5480 _this.$anchors.data('hover', true); 5481 }, _this.options.hoverDelay); 5482 } 5483 }).on('mouseleave.zf.dropdown', function () { 5484 clearTimeout(_this.timeout); 5485 _this.timeout = setTimeout(function () { 5486 _this.close(); 5487 _this.$anchors.data('hover', false); 5488 }, _this.options.hoverDelay); 5489 }); 5490 if (this.options.hoverPane) { 5491 this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 5492 clearTimeout(_this.timeout); 5493 }).on('mouseleave.zf.dropdown', function () { 5494 clearTimeout(_this.timeout); 5495 _this.timeout = setTimeout(function () { 5496 _this.close(); 5497 _this.$anchors.data('hover', false); 5498 }, _this.options.hoverDelay); 5499 }); 5500 } 5501 } 5502 this.$anchors.add(this.$element).on('keydown.zf.dropdown', function (e) { 5503 5504 var $target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 5505 visibleFocusableElements = __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].findFocusable(_this.$element); 5506 5507 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Dropdown', { 5508 open: function () { 5509 if ($target.is(_this.$anchors)) { 5510 _this.open(); 5511 _this.$element.attr('tabindex', -1).focus(); 5512 e.preventDefault(); 5513 } 5514 }, 5515 close: function () { 5516 _this.close(); 5517 _this.$anchors.focus(); 5518 } 5519 }); 5520 }); 5521 } 5522 5523 /** 5524 * Adds an event handler to the body to close any dropdowns on a click. 5525 * @function 5526 * @private 5527 */ 5528 5529 }, { 5530 key: '_addBodyHandler', 5531 value: function _addBodyHandler() { 5532 var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document.body).not(this.$element), 5533 _this = this; 5534 $body.off('click.zf.dropdown').on('click.zf.dropdown', function (e) { 5535 if (_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) { 5536 return; 5537 } 5538 if (_this.$element.find(e.target).length) { 5539 return; 5540 } 5541 _this.close(); 5542 $body.off('click.zf.dropdown'); 5543 }); 5544 } 5545 5546 /** 5547 * Opens the dropdown pane, and fires a bubbling event to close other dropdowns. 5548 * @function 5549 * @fires Dropdown#closeme 5550 * @fires Dropdown#show 5551 */ 5552 5553 }, { 5554 key: 'open', 5555 value: function open() { 5556 // var _this = this; 5557 /** 5558 * Fires to close other open dropdowns, typically when dropdown is opening 5559 * @event Dropdown#closeme 5560 */ 5561 this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id')); 5562 this.$anchors.addClass('hover').attr({ 'aria-expanded': true });
5563 // this.$element/*.show()*/; 5564 5565 this.$element.addClass('is-opening'); 5566 this._setPosition(); 5567 this.$element.removeClass('is-opening').addClass('is-open').attr({ 'aria-hidden': false }); 5568 5569 if (this.options.autoFocus) { 5570 var $focusable = __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].findFocusable(this.$element); 5571 if ($focusable.length) { 5572 $focusable.eq(0).focus(); 5573 } 5574 } 5575 5576 if (this.options.closeOnClick) { 5577 this._addBodyHandler(); 5578 } 5579 5580 if (this.options.trapFocus) { 5581 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].trapFocus(this.$element); 5582 } 5583 5584 /** 5585 * Fires once the dropdown is visible. 5586 * @event Dropdown#show 5587 */ 5588 this.$element.trigger('show.zf.dropdown', [this.$element]); 5589 } 5590 5591 /** 5592 * Closes the open dropdown pane. 5593 * @function 5594 * @fires Dropdown#hide 5595 */ 5596 5597 }, { 5598 key: 'close', 5599 value: function close() { 5600 if (!this.$element.hasClass('is-open')) { 5601 return false; 5602 } 5603 this.$element.removeClass('is-open').attr({ 'aria-hidden': true }); 5604 5605 this.$anchors.removeClass('hover').attr('aria-expanded', false); 5606 5607 /** 5608 * Fires once the dropdown is no longer visible. 5609 * @event Dropdown#hide 5610 */ 5611 this.$element.trigger('hide.zf.dropdown', [this.$element]); 5612 5613 if (this.options.trapFocus) { 5614 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].releaseFocus(this.$element); 5615 } 5616 } 5617 5618 /** 5619 * Toggles the dropdown pane's visibility. 5620 * @function 5621 */ 5622 5623 }, { 5624 key: 'toggle', 5625 value: function toggle() { 5626 if (this.$element.hasClass('is-open')) { 5627 if (this.$anchors.data('hover')) return; 5628 this.close(); 5629 } else { 5630 this.open(); 5631 } 5632 } 5633 5634 /** 5635 * Destroys the dropdown. 5636 * @function 5637 */ 5638 5639 }, { 5640 key: '_destroy', 5641 value: function _destroy() { 5642 this.$element.off('.zf.trigger').hide(); 5643 this.$anchors.off('.zf.dropdown'); 5644 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document.body).off('click.zf.dropdown'); 5645 } 5646 }]); 5647 5648 return Dropdown; 5649}(__WEBPACK_IMPORTED_MODULE_3__foundation_positionable__["a" /* Positionable */]); 5650 5651Dropdown.defaults = { 5652 /** 5653 * Class that designates bounding container of Dropdown (default: window) 5654 * @option 5655 * @type {?string} 5656 * @default null 5657 */ 5658 parentClass: null, 5659 /** 5660 * Amount of time to delay opening a submenu on hover event. 5661 * @option 5662 * @type {number} 5663 * @default 250 5664 */ 5665 hoverDelay: 250, 5666 /** 5667 * Allow submenus to open on hover events 5668 * @option 5669 * @type {boolean} 5670 * @default false 5671 */ 5672 hover: false, 5673 /** 5674 * Don't close dropdown when hovering over dropdown pane 5675 * @option 5676 * @type {boolean} 5677 * @default false 5678 */ 5679 hoverPane: false, 5680 /** 5681 * Number of pixels between the dropdown pane and the triggering element on open. 5682 * @option 5683 * @type {number} 5684 * @default 0 5685 */ 5686 vOffset: 0, 5687 /** 5688 * Number of pixels between the dropdown pane and the triggering element on open. 5689 * @option 5690 * @type {number} 5691 * @default 0 5692 */ 5693 hOffset: 0, 5694 /** 5695 * DEPRECATED: Class applied to adjust open position. 5696 * @option 5697 * @type {string} 5698 * @default '' 5699 */ 5700 positionClass: '', 5701 5702 /** 5703 * Position of dropdown. Can be left, right, bottom, top, or auto. 5704 * @option 5705 * @type {string} 5706 * @default 'auto' 5707 */ 5708 position: 'auto', 5709 /** 5710 * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto. 5711 * @option 5712 * @type {string} 5713 * @default 'auto' 5714 */ 5715 alignment: 'auto', 5716 /** 5717 * Allow overlap of container/window. If false, dropdown will first try to position as defined by data-position and data-alignment, but reposition if it would cause an overflow. 5718 * @option 5719 * @type {boolean} 5720 * @default false 5721 */ 5722 allowOverlap: false, 5723 /** 5724 * Allow overlap of only the bottom of the container. This is the most common 5725 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 5726 * screen but not otherwise influence or break out of the container. 5727 * @option 5728 * @type {boolean} 5729 * @default true 5730 */ 5731 allowBottomOverlap: true, 5732 /** 5733 * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. 5734 * @option 5735 * @type {boolean} 5736 * @default false 5737 */ 5738 trapFocus: false, 5739 /** 5740 * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. 5741 * @option 5742 * @type {boolean} 5743 * @default false 5744 */ 5745 autoFocus: false, 5746 /** 5747 * Allows a click on the body to close the dropdown. 5748 * @option 5749 * @type {boolean} 5750 * @default false 5751 */ 5752 closeOnClick: false 5753}; 5754 5755 5756 5757/***/ }), 5758/* 20 */ 5759/***/ (function(module, __webpack_exports__, __webpack_require__) { 5760 5761"use strict"; 5762/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Equalizer; }); 5763/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 5764/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 5765/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(3); 5766/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__ = __webpack_require__(8); 5767/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(1); 5768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2); 5769 5770 5771var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 5772 5773function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5774 5775function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 5776 5777function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
5777onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 5778 5779 5780 5781 5782 5783 5784 5785/** 5786 * Equalizer module. 5787 * @module foundation.equalizer 5788 * @requires foundation.util.mediaQuery 5789 * @requires foundation.util.imageLoader if equalizer contains images 5790 */ 5791 5792var Equalizer = function (_Plugin) { 5793 _inherits(Equalizer, _Plugin); 5794 5795 function Equalizer() { 5796 _classCallCheck(this, Equalizer); 5797 5798 return _possibleConstructorReturn(this, (Equalizer.__proto__ || Object.getPrototypeOf(Equalizer)).apply(this, arguments)); 5799 } 5800 5801 _createClass(Equalizer, [{ 5802 key: '_setup', 5803 5804 /** 5805 * Creates a new instance of Equalizer. 5806 * @class 5807 * @name Equalizer 5808 * @fires Equalizer#init 5809 * @param {Object} element - jQuery object to add the trigger to. 5810 * @param {Object} options - Overrides to the default plugin settings. 5811 */ 5812 value: function _setup(element, options) { 5813 this.$element = element; 5814 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Equalizer.defaults, this.$element.data(), options); 5815 this.className = 'Equalizer'; // ie9 back compat 5816 5817 this._init(); 5818 } 5819 5820 /** 5821 * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load. 5822 * @private 5823 */ 5824 5825 }, { 5826 key: '_init', 5827 value: function _init() { 5828 var eqId = this.$element.attr('data-equalizer') || ''; 5829 var $watched = this.$element.find('[data-equalizer-watch="' + eqId + '"]'); 5830 5831 __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 5832 5833 this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]'); 5834 this.$element.attr('data-resize', eqId || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'eq')); 5835 this.$element.attr('data-mutate', eqId || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'eq')); 5836 5837 this.hasNested = this.$element.find('[data-equalizer]').length > 0; 5838 this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0; 5839 this.isOn = false; 5840 this._bindHandler = { 5841 onResizeMeBound: this._onResizeMe.bind(this), 5842 onPostEqualizedBound: this._onPostEqualized.bind(this) 5843 }; 5844 5845 var imgs = this.$element.find('img'); 5846 var tooSmall; 5847 if (this.options.equalizeOn) { 5848 tooSmall = this._checkMQ(); 5849 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this)); 5850 } else { 5851 this._events(); 5852 } 5853 if (tooSmall !== undefined && tooSmall === false || tooSmall === undefined) { 5854 if (imgs.length) { 5855 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__["a" /* onImagesLoaded */])(imgs, this._reflow.bind(this)); 5856 } else { 5857 this._reflow(); 5858 } 5859 } 5860 } 5861 5862 /** 5863 * Removes event listeners if the breakpoint is too small. 5864 * @private 5865 */ 5866 5867 }, { 5868 key: '_pauseEvents', 5869 value: function _pauseEvents() { 5870 this.isOn = false; 5871 this.$element.off({ 5872 '.zf.equalizer': this._bindHandler.onPostEqualizedBound, 5873 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound, 5874 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound 5875 }); 5876 } 5877 5878 /** 5879 * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound 5880 * @private 5881 */ 5882 5883 }, { 5884 key: '_onResizeMe', 5885 value: function _onResizeMe(e) { 5886 this._reflow(); 5887 } 5888 5889 /** 5890 * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound 5891 * @private 5892 */ 5893 5894 }, { 5895 key: '_onPostEqualized', 5896 value: function _onPostEqualized(e) { 5897 if (e.target !== this.$element[0]) { 5898 this._reflow(); 5899 } 5900 } 5901 5902 /** 5903 * Initializes events for Equalizer. 5904 * @private 5905 */ 5906 5907 }, { 5908 key: '_events', 5909 value: function _events() { 5910 var _this = this; 5911 this._pauseEvents(); 5912 if (this.hasNested) {
vendor: 4,579 bytes, lines 5913-6056
5913 this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound); 5914 } else { 5915 this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound); 5916 this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound); 5917 } 5918 this.isOn = true; 5919 } 5920 5921 /** 5922 * Checks the current breakpoint to the minimum required size. 5923 * @private 5924 */ 5925 5926 }, { 5927 key: '_checkMQ', 5928 value: function _checkMQ() { 5929 var tooSmall = !__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].is(this.options.equalizeOn); 5930 if (tooSmall) { 5931 if (this.isOn) { 5932 this._pauseEvents(); 5933 this.$watched.css('height', 'auto'); 5934 } 5935 } else { 5936 if (!this.isOn) { 5937 this._events(); 5938 } 5939 } 5940 return tooSmall; 5941 } 5942 5943 /** 5944 * A noop version for the plugin 5945 * @private 5946 */ 5947 5948 }, { 5949 key: '_killswitch', 5950 value: function _killswitch() { 5951 return; 5952 } 5953 5954 /** 5955 * Calls necessary functions to update Equalizer upon DOM change 5956 * @private 5957 */ 5958 5959 }, { 5960 key: '_reflow', 5961 value: function _reflow() { 5962 if (!this.options.equalizeOnStack) { 5963 if (this._isStacked()) { 5964 this.$watched.css('height', 'auto'); 5965 return false; 5966 } 5967 } 5968 if (this.options.equalizeByRow) { 5969 this.getHeightsByRow(this.applyHeightByRow.bind(this)); 5970 } else { 5971 this.getHeights(this.applyHeight.bind(this)); 5972 } 5973 } 5974 5975 /** 5976 * Manually determines if the first 2 elements are *NOT* stacked. 5977 * @private 5978 */ 5979 5980 }, { 5981 key: '_isStacked', 5982 value: function _isStacked() { 5983 if (!this.$watched[0] || !this.$watched[1]) { 5984 return true; 5985 } 5986 return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top; 5987 } 5988 5989 /** 5990 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 5991 * @param {Function} cb - A non-optional callback to return the heights array to. 5992 * @returns {Array} heights - An array of heights of children within Equalizer container 5993 */ 5994 5995 }, { 5996 key: 'getHeights', 5997 value: function getHeights(cb) { 5998 var heights = []; 5999 for (var i = 0, len = this.$watched.length; i < len; i++) { 6000 this.$watched[i].style.height = 'auto'; 6001 heights.push(this.$watched[i].offsetHeight); 6002 } 6003 cb(heights); 6004 } 6005 6006 /** 6007 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 6008 * @param {Function} cb - A non-optional callback to return the heights array to. 6009 * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 6010 */ 6011 6012 }, { 6013 key: 'getHeightsByRow', 6014 value: function getHeightsByRow(cb) { 6015 var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0, 6016 groups = [], 6017 group = 0; 6018 //group by Row 6019 groups[group] = []; 6020 for (var i = 0, len = this.$watched.length; i < len; i++) { 6021 this.$watched[i].style.height = 'auto'; 6022 //maybe could use this.$watched[i].offsetTop 6023 var elOffsetTop = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$watched[i]).offset().top; 6024 if (elOffsetTop != lastElTopOffset) { 6025 group++; 6026 groups[group] = []; 6027 lastElTopOffset = elOffsetTop; 6028 } 6029 groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]); 6030 } 6031 6032 for (var j = 0, ln = groups.length; j < ln; j++) { 6033 var heights = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(groups[j]).map(function () { 6034 return this[1]; 6035 }).get(); 6036 var max = Math.max.apply(null, heights); 6037 groups[j].push(max); 6038 } 6039 cb(groups); 6040 } 6041 6042 /** 6043 * Changes the CSS height property of each child in an Equalizer parent to match the tallest 6044 * @param {array} heights - An array of heights of children within Equalizer container 6045 * @fires Equalizer#preequalized 6046 * @fires Equalizer#postequalized 6047 */ 6048 6049 }, { 6050 key: 'applyHeight', 6051 value: function applyHeight(heights) { 6052 var max = Math.max.apply(null, heights); 6053 /** 6054 * Fires before the heights are applied 6055 * @event Equalizer#preequalized 6056 */
6057 this.$element.trigger('preequalized.zf.equalizer'); 6058 6059 this.$watched.css('height', max); 6060 6061 /** 6062 * Fires when the heights have been applied 6063 * @event Equalizer#postequalized 6064 */ 6065 this.$element.trigger('postequalized.zf.equalizer'); 6066 } 6067 6068 /** 6069 * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row 6070 * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 6071 * @fires Equalizer#preequalized 6072 * @fires Equalizer#preequalizedrow 6073 * @fires Equalizer#postequalizedrow 6074 * @fires Equalizer#postequalized 6075 */ 6076 6077 }, { 6078 key: 'applyHeightByRow', 6079 value: function applyHeightByRow(groups) { 6080 /** 6081 * Fires before the heights are applied 6082 */ 6083 this.$element.trigger('preequalized.zf.equalizer'); 6084 for (var i = 0, len = groups.length; i < len; i++) { 6085 var groupsILength = groups[i].length, 6086 max = groups[i][groupsILength - 1]; 6087 if (groupsILength <= 2) { 6088 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(groups[i][0][0]).css({ 'height': 'auto' }); 6089 continue; 6090 } 6091 /** 6092 * Fires before the heights per row are applied 6093 * @event Equalizer#preequalizedrow 6094 */ 6095 this.$element.trigger('preequalizedrow.zf.equalizer'); 6096 for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) { 6097 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(groups[i][j][0]).css({ 'height': max }); 6098 } 6099 /** 6100 * Fires when the heights per row have been applied 6101 * @event Equalizer#postequalizedrow 6102 */ 6103 this.$element.trigger('postequalizedrow.zf.equalizer'); 6104 } 6105 /** 6106 * Fires when the heights have been applied 6107 */ 6108 this.$element.trigger('postequalized.zf.equalizer'); 6109 } 6110 6111 /** 6112 * Destroys an instance of Equalizer. 6113 * @function 6114 */ 6115 6116 }, { 6117 key: '_destroy', 6118 value: function _destroy() { 6119 this._pauseEvents(); 6120 this.$watched.css('height', 'auto'); 6121 } 6122 }]); 6123 6124 return Equalizer; 6125}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["a" /* Plugin */]); 6126 6127/** 6128 * Default settings for plugin 6129 */ 6130 6131 6132Equalizer.defaults = { 6133 /** 6134 * Enable height equalization when stacked on smaller screens. 6135 * @option 6136 * @type {boolean} 6137 * @default false 6138 */ 6139 equalizeOnStack: false, 6140 /** 6141 * Enable height equalization row by row. 6142 * @option 6143 * @type {boolean} 6144 * @default false 6145 */ 6146 equalizeByRow: false, 6147 /** 6148 * String representing the minimum breakpoint size the plugin should equalize heights on. 6149 * @option 6150 * @type {string} 6151 * @default '' 6152 */ 6153 equalizeOn: '' 6154}; 6155 6156 6157 6158/***/ }), 6159/* 21 */ 6160/***/ (function(module, __webpack_exports__, __webpack_require__) { 6161 6162"use strict"; 6163/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Interchange; }); 6164/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 6165/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 6166/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(3); 6167/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2); 6168/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(1); 6169 6170 6171var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 6172 6173function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6174 6175function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 6176 6177function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
6177onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 6178 6179 6180 6181 6182 6183 6184/** 6185 * Interchange module. 6186 * @module foundation.interchange 6187 * @requires foundation.util.mediaQuery 6188 */ 6189 6190var Interchange = function (_Plugin) { 6191 _inherits(Interchange, _Plugin); 6192 6193 function Interchange() { 6194 _classCallCheck(this, Interchange); 6195 6196 return _possibleConstructorReturn(this, (Interchange.__proto__ || Object.getPrototypeOf(Interchange)).apply(this, arguments)); 6197 } 6198 6199 _createClass(Interchange, [{ 6200 key: '_setup', 6201 6202 /** 6203 * Creates a new instance of Interchange. 6204 * @class 6205 * @name Interchange 6206 * @fires Interchange#init 6207 * @param {Object} element - jQuery object to add the trigger to. 6208 * @param {Object} options - Overrides to the default plugin settings. 6209 */ 6210 value: function _setup(element, options) { 6211 this.$element = element; 6212 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Interchange.defaults, options); 6213 this.rules = []; 6214 this.currentPath = ''; 6215 this.className = 'Interchange'; // ie9 back compat 6216 6217 this._init(); 6218 this._events(); 6219 } 6220 6221 /** 6222 * Initializes the Interchange plugin and calls functions to get interchange functioning on load. 6223 * @function 6224 * @private 6225 */ 6226 6227 }, { 6228 key: '_init', 6229 value: function _init() { 6230 __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 6231 6232 var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'interchange'); 6233 this.$element.attr({ 6234 'data-resize': id, 6235 'id': id 6236 }); 6237 6238 this._addBreakpoints(); 6239 this._generateRules(); 6240 this._reflow(); 6241 } 6242 6243 /** 6244 * Initializes events for Interchange. 6245 * @function 6246 * @private 6247 */ 6248 6249 }, { 6250 key: '_events', 6251 value: function _events() { 6252 var _this3 = this; 6253 6254 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () { 6255 return _this3._reflow(); 6256 }); 6257 } 6258 6259 /** 6260 * Calls necessary functions to update Interchange upon DOM change 6261 * @function 6262 * @private 6263 */ 6264 6265 }, { 6266 key: '_reflow', 6267 value: function _reflow() { 6268 var match; 6269 6270 // Iterate through each rule, but only save the last match 6271 for (var i in this.rules) { 6272 if (this.rules.hasOwnProperty(i)) { 6273 var rule = this.rules[i]; 6274 if (window.matchMedia(rule.query).matches) { 6275 match = rule; 6276 } 6277 } 6278 } 6279 6280 if (match) { 6281 this.replace(match.path); 6282 } 6283 } 6284 6285 /** 6286 * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object. 6287 * @function 6288 * @private 6289 */ 6290 6291 }, { 6292 key: '_addBreakpoints', 6293 value: function _addBreakpoints() { 6294 for (var i in __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].queries) { 6295 if (__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].queries.hasOwnProperty(i)) { 6296 var query = __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].queries[i]; 6297 Interchange.SPECIAL_QUERIES[query.name] = query.value; 6298 } 6299 } 6300 } 6301 6302 /** 6303 * Checks the Interchange element for the provided media query + content pairings 6304 * @function 6305 * @private 6306 * @param {Object} element - jQuery object that is an Interchange instance 6307 * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys 6308 */ 6309 6310 }, { 6311 key: '_generateRules', 6312 value: function _generateRules(element) { 6313 var rulesList = []; 6314 var rules; 6315 6316 if (this.options.rules) { 6317 rules = this.options.rules;
6318 } else { 6319 rules = this.$element.data('interchange'); 6320 } 6321 6322 rules = typeof rules === 'string' ? rules.match(/\[.*?\]/g) : rules; 6323 6324 for (var i in rules) { 6325 if (rules.hasOwnProperty(i)) { 6326 var rule = rules[i].slice(1, -1).split(', '); 6327 var path = rule.slice(0, -1).join(''); 6328 var query = rule[rule.length - 1]; 6329 6330 if (Interchange.SPECIAL_QUERIES[query]) { 6331 query = Interchange.SPECIAL_QUERIES[query]; 6332 } 6333 6334 rulesList.push({ 6335 path: path, 6336 query: query 6337 }); 6338 } 6339 } 6340 6341 this.rules = rulesList; 6342 } 6343 6344 /** 6345 * Update the `src` property of an image, or change the HTML of a container, to the specified path. 6346 * @function 6347 * @param {String} path - Path to the image or HTML partial. 6348 * @fires Interchange#replaced 6349 */ 6350 6351 }, { 6352 key: 'replace', 6353 value: function replace(path) { 6354 if (this.currentPath === path) return; 6355 6356 var _this = this, 6357 trigger = 'replaced.zf.interchange'; 6358 6359 // Replacing images 6360 if (this.$element[0].nodeName === 'IMG') { 6361 this.$element.attr('src', path).on('load', function () { 6362 _this.currentPath = path; 6363 }).trigger(trigger); 6364 } 6365 // Replacing background images 6366 else if (path.match(/\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) { 6367 path = path.replace(/\(/g, '%28').replace(/\)/g, '%29'); 6368 this.$element.css({ 'background-image': 'url(' + path + ')' }).trigger(trigger); 6369 } 6370 // Replacing HTML 6371 else { 6372 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.get(path, function (response) { 6373 _this.$element.html(response).trigger(trigger); 6374 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(response).foundation(); 6375 _this.currentPath = path; 6376 }); 6377 } 6378 6379 /** 6380 * Fires when content in an Interchange element is done being loaded. 6381 * @event Interchange#replaced 6382 */ 6383 // this.$element.trigger('replaced.zf.interchange'); 6384 } 6385 6386 /** 6387 * Destroys an instance of interchange. 6388 * @function 6389 */ 6390 6391 }, { 6392 key: '_destroy', 6393 value: function _destroy() { 6394 this.$element.off('resizeme.zf.trigger'); 6395 } 6396 }]); 6397 6398 return Interchange; 6399}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["a" /* Plugin */]); 6400 6401/** 6402 * Default settings for plugin 6403 */ 6404 6405 6406Interchange.defaults = { 6407 /** 6408 * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation. 6409 * @option 6410 * @type {?array} 6411 * @default null 6412 */ 6413 rules: null 6414}; 6415 6416Interchange.SPECIAL_QUERIES = { 6417 'landscape': 'screen and (orientation: landscape)', 6418 'portrait': 'screen and (orientation: portrait)', 6419 'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)' 6420}; 6421 6422 6423 6424/***/ }), 6425/* 22 */ 6426/***/ (function(module, __webpack_exports__, __webpack_require__) { 6427 6428"use strict"; 6429/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Magellan; }); 6430/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 6431/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 6432/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 6433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2); 6434/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_smoothScroll__ = __webpack_require__(33); 6435 6436 6437var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 6438 6439function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6440 6441function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 6442 6443function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
6443onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 6444 6445 6446 6447 6448 6449 6450/** 6451 * Magellan module. 6452 * @module foundation.magellan 6453 * @requires foundation.smoothScroll 6454 */ 6455 6456var Magellan = function (_Plugin) { 6457 _inherits(Magellan, _Plugin); 6458 6459 function Magellan() { 6460 _classCallCheck(this, Magellan); 6461 6462 return _possibleConstructorReturn(this, (Magellan.__proto__ || Object.getPrototypeOf(Magellan)).apply(this, arguments)); 6463 } 6464 6465 _createClass(Magellan, [{ 6466 key: '_setup', 6467 6468 /** 6469 * Creates a new instance of Magellan. 6470 * @class 6471 * @name Magellan 6472 * @fires Magellan#init 6473 * @param {Object} element - jQuery object to add the trigger to. 6474 * @param {Object} options - Overrides to the default plugin settings. 6475 */ 6476 value: function _setup(element, options) { 6477 this.$element = element; 6478 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Magellan.defaults, this.$element.data(), options); 6479 this.className = 'Magellan'; // ie9 back compat 6480 6481 this._init(); 6482 this.calcPoints();
vendor: 3,977 bytes, lines 6483-6608
6483 } 6484 6485 /** 6486 * Initializes the Magellan plugin and calls functions to get equalizer functioning on load. 6487 * @private 6488 */ 6489 6490 }, { 6491 key: '_init', 6492 value: function _init() { 6493 var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["a" /* GetYoDigits */])(6, 'magellan'); 6494 var _this = this; 6495 this.$targets = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-magellan-target]'); 6496 this.$links = this.$element.find('a'); 6497 this.$element.attr({ 6498 'data-resize': id, 6499 'data-scroll': id, 6500 'id': id 6501 }); 6502 this.$active = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(); 6503 this.scrollPos = parseInt(window.pageYOffset, 10); 6504 6505 this._events(); 6506 } 6507 6508 /** 6509 * Calculates an array of pixel values that are the demarcation lines between locations on the page. 6510 * Can be invoked if new elements are added or the size of a location changes. 6511 * @function 6512 */ 6513 6514 }, { 6515 key: 'calcPoints', 6516 value: function calcPoints() { 6517 var _this = this, 6518 body = document.body, 6519 html = document.documentElement; 6520 6521 this.points = []; 6522 this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight)); 6523 this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)); 6524 6525 this.$targets.each(function () { 6526 var $tar = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 6527 pt = Math.round($tar.offset().top - _this.options.threshold); 6528 $tar.targetPoint = pt; 6529 _this.points.push(pt); 6530 }); 6531 } 6532 6533 /** 6534 * Initializes events for Magellan. 6535 * @private 6536 */ 6537 6538 }, { 6539 key: '_events', 6540 value: function _events() { 6541 var _this = this, 6542 $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body'), 6543 opts = { 6544 duration: _this.options.animationDuration, 6545 easing: _this.options.animationEasing 6546 }; 6547 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).one('load', function () { 6548 if (_this.options.deepLinking) { 6549 if (location.hash) { 6550 _this.scrollToLoc(location.hash); 6551 } 6552 } 6553 _this.calcPoints(); 6554 _this._updateActive(); 6555 }); 6556 6557 this.$element.on({ 6558 'resizeme.zf.trigger': this.reflow.bind(this), 6559 'scrollme.zf.trigger': this._updateActive.bind(this) 6560 }).on('click.zf.magellan', 'a[href^="#"]', function (e) { 6561 e.preventDefault(); 6562 var arrival = this.getAttribute('href'); 6563 _this.scrollToLoc(arrival); 6564 }); 6565 6566 this._deepLinkScroll = function (e) { 6567 if (_this.options.deepLinking) { 6568 _this.scrollToLoc(window.location.hash); 6569 } 6570 }; 6571 6572 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._deepLinkScroll); 6573 } 6574 6575 /** 6576 * Function to scroll to a given location on the page. 6577 * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo' 6578 * @function 6579 */ 6580 6581 }, { 6582 key: 'scrollToLoc', 6583 value: function scrollToLoc(loc) { 6584 this._inTransition = true; 6585 var _this = this; 6586 6587 var options = { 6588 animationEasing: this.options.animationEasing, 6589 animationDuration: this.options.animationDuration, 6590 threshold: this.options.threshold, 6591 offset: this.options.offset 6592 }; 6593 6594 __WEBPACK_IMPORTED_MODULE_3__foundation_smoothScroll__["a" /* SmoothScroll */].scrollToLoc(loc, options, function () { 6595 _this._inTransition = false; 6596 _this._updateActive(); 6597 }); 6598 } 6599 6600 /** 6601 * Calls necessary functions to update Magellan upon DOM change 6602 * @function 6603 */ 6604 6605 }, { 6606 key: 'reflow', 6607 value: function reflow() { 6608 this.calcPoints();
6609 this._updateActive(); 6610 } 6611 6612 /** 6613 * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled. 6614 * @private 6615 * @function 6616 * @fires Magellan#update 6617 */ 6618 6619 }, { 6620 key: '_updateActive', 6621 value: function _updateActive() /*evt, elem, scrollPos*/{ 6622 if (this._inTransition) { 6623 return; 6624 } 6625 var winPos = /*scrollPos ||*/parseInt(window.pageYOffset, 10), 6626 curIdx; 6627 6628 if (winPos + this.winHeight === this.docHeight) { 6629 curIdx = this.points.length - 1; 6630 } else if (winPos < this.points[0]) { 6631 curIdx = undefined; 6632 } else { 6633 var isDown = this.scrollPos < winPos, 6634 _this = this, 6635 curVisible = this.points.filter(function (p, i) { 6636 return isDown ? p - _this.options.offset <= winPos : p - _this.options.offset - _this.options.threshold <= winPos; 6637 }); 6638 curIdx = curVisible.length ? curVisible.length - 1 : 0; 6639 } 6640 6641 this.$active.removeClass(this.options.activeClass); 6642 this.$active = this.$links.filter('[href="#' + this.$targets.eq(curIdx).data('magellan-target') + '"]').addClass(this.options.activeClass); 6643 6644 if (this.options.deepLinking) { 6645 var hash = ""; 6646 if (curIdx != undefined) { 6647 hash = this.$active[0].getAttribute('href'); 6648 } 6649 if (hash !== window.location.hash) { 6650 if (window.history.pushState) { 6651 window.history.pushState(null, null, hash); 6652 } else { 6653 window.location.hash = hash; 6654 } 6655 } 6656 } 6657 6658 this.scrollPos = winPos; 6659 /** 6660 * Fires when magellan is finished updating to the new active element. 6661 * @event Magellan#update 6662 */ 6663 this.$element.trigger('update.zf.magellan', [this.$active]); 6664 } 6665 6666 /** 6667 * Destroys an instance of Magellan and resets the url of the window. 6668 * @function 6669 */ 6670 6671 }, { 6672 key: '_destroy', 6673 value: function _destroy() { 6674 this.$element.off('.zf.trigger .zf.magellan').find('.' + this.options.activeClass).removeClass(this.options.activeClass); 6675 6676 if (this.options.deepLinking) { 6677 var hash = this.$active[0].getAttribute('href'); 6678 window.location.hash.replace(hash, ''); 6679 } 6680 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._deepLinkScroll); 6681 } 6682 }]); 6683 6684 return Magellan; 6685}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["a" /* Plugin */]); 6686 6687/** 6688 * Default settings for plugin 6689 */ 6690 6691 6692Magellan.defaults = { 6693 /** 6694 * Amount of time, in ms, the animated scrolling should take between locations. 6695 * @option 6696 * @type {number} 6697 * @default 500 6698 */ 6699 animationDuration: 500, 6700 /** 6701 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 6702 * @option 6703 * @type {string} 6704 * @default 'linear' 6705 * @see {@link https://api.jquery.com/animate|Jquery animate} 6706 */ 6707 animationEasing: 'linear', 6708 /** 6709 * Number of pixels to use as a marker for location changes. 6710 * @option 6711 * @type {number} 6712 * @default 50 6713 */ 6714 threshold: 50, 6715 /** 6716 * Class applied to the active locations link on the magellan container. 6717 * @option 6718 * @type {string} 6719 * @default 'is-active' 6720 */ 6721 activeClass: 'is-active', 6722 /** 6723 * Allows the script to manipulate the url of the current page, and if supported, alter the history. 6724 * @option 6725 * @type {boolean} 6726 * @default false 6727 */ 6728 deepLinking: false, 6729 /** 6730 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 6731 * @option 6732 * @type {number} 6733 * @default 0 6734 */ 6735 offset: 0 6736}; 6737 6738 6739 6740/***/ }), 6741/* 23 */ 6742/***/ (function(module, __webpack_exports__, __webpack_require__) { 6743 6744"use strict"; 6745/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OffCanvas; }); 6746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 6747/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 6748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 6749/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(3); 6750/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(1); 6751/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2); 6752/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_triggers__ = __webpack_require__(5); 6753 6754 6755var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 6756 6757function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6758 6759function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 6760 6761function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
6761onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771/** 6772 * OffCanvas module. 6773 * @module foundation.offcanvas 6774 * @requires foundation.util.keyboard 6775 * @requires foundation.util.mediaQuery 6776 * @requires foundation.util.triggers 6777 */ 6778 6779var OffCanvas = function (_Plugin) { 6780 _inherits(OffCanvas, _Plugin); 6781 6782 function OffCanvas() { 6783 _classCallCheck(this, OffCanvas); 6784 6785 return _possibleConstructorReturn(this, (OffCanvas.__proto__ || Object.getPrototypeOf(OffCanvas)).apply(this, arguments)); 6786 } 6787 6788 _createClass(OffCanvas, [{ 6789 key: '_setup', 6790 6791 /** 6792 * Creates a new instance of an off-canvas wrapper. 6793 * @class 6794 * @name OffCanvas 6795 * @fires OffCanvas#init 6796 * @param {Object} element - jQuery object to initialize. 6797 * @param {Object} options - Overrides to the default plugin settings. 6798 */ 6799 value: function _setup(element, options) { 6800 var _this3 = this; 6801 6802 this.className = 'OffCanvas'; // ie9 back compat 6803 this.$element = element; 6804 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, OffCanvas.defaults, this.$element.data(), options); 6805 this.contentClasses = { base: [], reveal: [] }; 6806 this.$lastTrigger = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(); 6807 this.$triggers = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(); 6808 this.position = 'left'; 6809 this.$content = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(); 6810 this.nested = !!this.options.nested; 6811 6812 // Defines the CSS transition/position classes of the off-canvas content container. 6813 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(['push', 'overlap']).each(function (index, val) { 6814 _this3.contentClasses.base.push('has-transition-' + val); 6815 }); 6816 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(['left', 'right', 'top', 'bottom']).each(function (index, val) { 6817 _this3.contentClasses.base.push('has-position-' + val); 6818 _this3.contentClasses.reveal.push('has-reveal-' + val); 6819 }); 6820 6821 // Triggers init is idempotent, just need to make sure it is initialized 6822 __WEBPACK_IMPORTED_MODULE_5__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 6823 __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 6824 6825 this._init(); 6826 this._events(); 6827 6828 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('OffCanvas', { 6829 'ESCAPE': 'close' 6830 }); 6831 } 6832 6833 /** 6834 * Initializes the off-canvas wrapper by adding the exit overlay (if needed). 6835 * @function 6836 * @private 6837 */ 6838 6839 }, { 6840 key: '_init', 6841 value: function _init() { 6842 var id = this.$element.attr('id'); 6843 6844 this.$element.attr('aria-hidden', 'true'); 6845 6846 // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback) 6847 if (this.options.contentId) { 6848 this.$content = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + this.options.contentId); 6849 } else if (this.$element.siblings('[data-off-canvas-content]').length) { 6850 this.$content = this.$element.siblings('[data-off-canvas-content]').first(); 6851 } else { 6852 this.$content = this.$element.closest('[data-off-canvas-content]').first(); 6853 } 6854 6855 if (!this.options.contentId) { 6856 // Assume that the off-canvas element is nested if it isn't a sibling of the content 6857 this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0; 6858 } else if (this.options.contentId && this.options.nested === null) { 6859 // Warning if using content ID without setting the nested option 6860 // Once the element is nested it is required to work properly in this case 6861 console.warn('Remember to use the nested option if using the content ID option!'); 6862 } 6863 6864 if (this.nested === true) { 6865 // Force transition overlap if nested 6866 this.options.transition = 'overlap'; 6867 // Remove appropriate classes if already assigned in markup 6868 this.$element.removeClass('is-transition-push'); 6869 } 6870 6871 this.$element.addClass('is-transition-' + this.options.transition + ' is-closed'); 6872 6873 // Find triggers that affect this element and add aria-expanded to them 6874 this.$triggers = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).find('[data-open="' + id + '"], [data-close="' + id + '"], [data-toggle="' + id + '"]').attr('aria-expanded', 'false').attr('aria-controls', id); 6875 6876 // Get position by checking for related CSS class 6877 this.position = this.$element.is('.position-left, .position-top, .position-right, .position-bottom') ? this.$element.attr('class').match(/position\-(left|top|right|bottom)/)[1] : this.position; 6878 6879 // Add an overlay over the content if necessary 6880 if (this.options.contentOverlay === true) {
6881 var overlay = document.createElement('div'); 6882 var overlayPosition = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute'; 6883 overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition); 6884 this.$overlay = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(overlay); 6885 if (overlayPosition === 'is-overlay-fixed') { 6886 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$overlay).insertAfter(this.$element); 6887 } else { 6888 this.$content.append(this.$overlay); 6889 } 6890 } 6891 6892 this.options.isRevealed = this.options.isRevealed || new RegExp(this.options.revealClass, 'g').test(this.$element[0].className); 6893 6894 if (this.options.isRevealed === true) { 6895 this.options.revealOn = this.options.revealOn || this.$element[0].className.match(/(reveal-for-medium|reveal-for-large)/g)[0].split('-')[2]; 6896 this._setMQChecker(); 6897 } 6898 6899 if (this.options.transitionTime) { 6900 this.$element.css('transition-duration', this.options.transitionTime); 6901 } 6902 6903 // Initally remove all transition/position CSS classes from off-canvas content container. 6904 this._removeContentClasses(); 6905 } 6906 6907 /** 6908 * Adds event handlers to the off-canvas wrapper and the exit overlay. 6909 * @function 6910 * @private 6911 */ 6912 6913 }, { 6914 key: '_events', 6915 value: function _events() { 6916 this.$element.off('.zf.trigger .zf.offcanvas').on({ 6917 'open.zf.trigger': this.open.bind(this), 6918 'close.zf.trigger': this.close.bind(this), 6919 'toggle.zf.trigger': this.toggle.bind(this), 6920 'keydown.zf.offcanvas': this._handleKeyboard.bind(this) 6921 }); 6922 6923 if (this.options.closeOnClick === true) { 6924 var $target = this.options.contentOverlay ? this.$overlay : this.$content; 6925 $target.on({ 'click.zf.offcanvas': this.close.bind(this) }); 6926 } 6927 } 6928 6929 /** 6930 * Applies event listener for elements that will reveal at certain breakpoints. 6931 * @private 6932 */ 6933 6934 }, { 6935 key: '_setMQChecker', 6936 value: function _setMQChecker() { 6937 var _this = this; 6938 6939 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', function () { 6940 if (__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */].atLeast(_this.options.revealOn)) { 6941 _this.reveal(true); 6942 } else { 6943 _this.reveal(false); 6944 } 6945 }).one('load.zf.offcanvas', function () { 6946 if (__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */].atLeast(_this.options.revealOn)) { 6947 _this.reveal(true); 6948 } 6949 }); 6950 } 6951 6952 /** 6953 * Removes the CSS transition/position classes of the off-canvas content container. 6954 * Removing the classes is important when another off-canvas gets opened that uses the same content container. 6955 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 6956 * @private 6957 */ 6958 6959 }, { 6960 key: '_removeContentClasses', 6961 value: function _removeContentClasses(hasReveal) { 6962 if (typeof hasReveal !== 'boolean') { 6963 this.$content.removeClass(this.contentClasses.base.join(' ')); 6964 } else if (hasReveal === false) { 6965 this.$content.removeClass('has-reveal-' + this.position); 6966 } 6967 } 6968 6969 /** 6970 * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element. 6971 * Beforehand any transition/position class gets removed. 6972 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 6973 * @private 6974 */ 6975 6976 }, { 6977 key: '_addContentClasses', 6978 value: function _addContentClasses(hasReveal) { 6979 this._removeContentClasses(hasReveal); 6980 if (typeof hasReveal !== 'boolean') { 6981 this.$content.addClass('has-transition-' + this.options.transition + ' has-position-' + this.position); 6982 } else if (hasReveal === true) { 6983 this.$content.addClass('has-reveal-' + this.position); 6984 } 6985 } 6986 6987 /**
vendor: 9,359 bytes, lines 6988-7267
6988 * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open. 6989 * @param {Boolean} isRevealed - true if element should be revealed. 6990 * @function 6991 */ 6992 6993 }, { 6994 key: 'reveal', 6995 value: function reveal(isRevealed) { 6996 if (isRevealed) { 6997 this.close(); 6998 this.isRevealed = true; 6999 this.$element.attr('aria-hidden', 'false'); 7000 this.$element.off('open.zf.trigger toggle.zf.trigger'); 7001 this.$element.removeClass('is-closed'); 7002 } else { 7003 this.isRevealed = false; 7004 this.$element.attr('aria-hidden', 'true'); 7005 this.$element.off('open.zf.trigger toggle.zf.trigger').on({ 7006 'open.zf.trigger': this.open.bind(this), 7007 'toggle.zf.trigger': this.toggle.bind(this) 7008 }); 7009 this.$element.addClass('is-closed'); 7010 } 7011 this._addContentClasses(isRevealed); 7012 } 7013 7014 /** 7015 * Stops scrolling of the body when offcanvas is open on mobile Safari and other troublesome browsers. 7016 * @private 7017 */ 7018 7019 }, { 7020 key: '_stopScrolling', 7021 value: function _stopScrolling(event) { 7022 return false; 7023 } 7024 7025 // Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios 7026 // Only really works for y, not sure how to extend to x or if we need to. 7027 7028 }, { 7029 key: '_recordScrollable', 7030 value: function _recordScrollable(event) { 7031 var elem = this; // called from event handler context with this as elem 7032 7033 // If the element is scrollable (content overflows), then... 7034 if (elem.scrollHeight !== elem.clientHeight) { 7035 // If we're at the top, scroll down one pixel to allow scrolling up 7036 if (elem.scrollTop === 0) { 7037 elem.scrollTop = 1; 7038 } 7039 // If we're at the bottom, scroll up one pixel to allow scrolling down 7040 if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) { 7041 elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1; 7042 } 7043 } 7044 elem.allowUp = elem.scrollTop > 0; 7045 elem.allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight; 7046 elem.lastY = event.originalEvent.pageY; 7047 } 7048 }, { 7049 key: '_stopScrollPropagation', 7050 value: function _stopScrollPropagation(event) { 7051 var elem = this; // called from event handler context with this as elem 7052 var up = event.pageY < elem.lastY; 7053 var down = !up; 7054 elem.lastY = event.pageY; 7055 7056 if (up && elem.allowUp || down && elem.allowDown) { 7057 event.stopPropagation(); 7058 } else { 7059 event.preventDefault(); 7060 } 7061 } 7062 7063 /** 7064 * Opens the off-canvas menu. 7065 * @function 7066 * @param {Object} event - Event object passed from listener. 7067 * @param {jQuery} trigger - element that triggered the off-canvas to open. 7068 * @fires OffCanvas#opened 7069 */ 7070 7071 }, { 7072 key: 'open', 7073 value: function open(event, trigger) { 7074 if (this.$element.hasClass('is-open') || this.isRevealed) { 7075 return; 7076 } 7077 var _this = this; 7078 7079 if (trigger) { 7080 this.$lastTrigger = trigger; 7081 } 7082 7083 if (this.options.forceTo === 'top') { 7084 window.scrollTo(0, 0); 7085 } else if (this.options.forceTo === 'bottom') { 7086 window.scrollTo(0, document.body.scrollHeight); 7087 } 7088 7089 if (this.options.transitionTime && this.options.transition !== 'overlap') { 7090 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime); 7091 } else { 7092 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', ''); 7093 } 7094 7095 /** 7096 * Fires when the off-canvas menu opens. 7097 * @event OffCanvas#opened 7098 */ 7099 this.$element.addClass('is-open').removeClass('is-closed'); 7100 7101 this.$triggers.attr('aria-expanded', 'true'); 7102 this.$element.attr('aria-hidden', 'false').trigger('opened.zf.offcanvas'); 7103 7104 this.$content.addClass('is-open-' + this.position); 7105 7106 // If `contentScroll` is set to false, add class and disable scrolling on touch devices. 7107 if (this.options.contentScroll === false) { 7108 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling); 7109 this.$element.on('touchstart', this._recordScrollable); 7110 this.$element.on('touchmove', this._stopScrollPropagation); 7111 } 7112 7113 if (this.options.contentOverlay === true) { 7114 this.$overlay.addClass('is-visible'); 7115 } 7116 7117 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 7118 this.$overlay.addClass('is-closable'); 7119 } 7120 7121 if (this.options.autoFocus === true) { 7122 this.$element.one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])(this.$element), function () { 7123 if (!_this.$element.hasClass('is-open')) { 7124 return; // exit if prematurely closed 7125 } 7126 var canvasFocus = _this.$element.find('[data-autofocus]'); 7127 if (canvasFocus.length) { 7128 canvasFocus.eq(0).focus(); 7129 } else { 7130 _this.$element.find('a, button').eq(0).focus(); 7131 } 7132 }); 7133 } 7134 7135 if (this.options.trapFocus === true) { 7136 this.$content.attr('tabindex', '-1'); 7137 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].trapFocus(this.$element); 7138 } 7139 7140 this._addContentClasses(); 7141 } 7142 7143 /** 7144 * Closes the off-canvas menu. 7145 * @function 7146 * @param {Function} cb - optional cb to fire after closure. 7147 * @fires OffCanvas#closed 7148 */ 7149 7150 }, { 7151 key: 'close', 7152 value: function close(cb) { 7153 if (!this.$element.hasClass('is-open') || this.isRevealed) { 7154 return; 7155 } 7156 7157 var _this = this; 7158 7159 this.$element.removeClass('is-open'); 7160 7161 this.$element.attr('aria-hidden', 'true') 7162 /** 7163 * Fires when the off-canvas menu opens. 7164 * @event OffCanvas#closed 7165 */ 7166 .trigger('closed.zf.offcanvas'); 7167 7168 this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom'); 7169 7170 // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices. 7171 if (this.options.contentScroll === false) { 7172 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling); 7173 this.$element.off('touchstart', this._recordScrollable); 7174 this.$element.off('touchmove', this._stopScrollPropagation); 7175 } 7176 7177 if (this.options.contentOverlay === true) { 7178 this.$overlay.removeClass('is-visible'); 7179 } 7180 7181 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 7182 this.$overlay.removeClass('is-closable'); 7183 } 7184 7185 this.$triggers.attr('aria-expanded', 'false'); 7186 7187 if (this.options.trapFocus === true) { 7188 this.$content.removeAttr('tabindex'); 7189 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].releaseFocus(this.$element); 7190 } 7191 7192 // Listen to transitionEnd and add class when done. 7193 this.$element.one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["c" /* transitionend */])(this.$element), function (e) { 7194 _this.$element.addClass('is-closed'); 7195 _this._removeContentClasses(); 7196 }); 7197 } 7198 7199 /** 7200 * Toggles the off-canvas menu open or closed. 7201 * @function 7202 * @param {Object} event - Event object passed from listener. 7203 * @param {jQuery} trigger - element that triggered the off-canvas to open. 7204 */ 7205 7206 }, { 7207 key: 'toggle', 7208 value: function toggle(event, trigger) { 7209 if (this.$element.hasClass('is-open')) { 7210 this.close(event, trigger); 7211 } else { 7212 this.open(event, trigger); 7213 } 7214 } 7215 7216 /** 7217 * Handles keyboard input when detected. When the escape key is pressed, the off-canvas menu closes, and focus is restored to the element that opened the menu. 7218 * @function 7219 * @private 7220 */ 7221 7222 }, { 7223 key: '_handleKeyboard', 7224 value: function _handleKeyboard(e) { 7225 var _this4 = this; 7226 7227 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'OffCanvas', { 7228 close: function () { 7229 _this4.close(); 7230 _this4.$lastTrigger.focus(); 7231 return true; 7232 }, 7233 handled: function () { 7234 e.stopPropagation(); 7235 e.preventDefault(); 7236 } 7237 }); 7238 } 7239 7240 /** 7241 * Destroys the offcanvas plugin. 7242 * @function 7243 */ 7244 7245 }, { 7246 key: '_destroy', 7247 value: function _destroy() { 7248 this.close(); 7249 this.$element.off('.zf.trigger .zf.offcanvas'); 7250 this.$overlay.off('.zf.offcanvas'); 7251 } 7252 }]); 7253 7254 return OffCanvas; 7255}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["a" /* Plugin */]); 7256 7257OffCanvas.defaults = { 7258 /** 7259 * Allow the user to click outside of the menu to close it. 7260 * @option 7261 * @type {boolean} 7262 * @default true 7263 */ 7264 closeOnClick: true, 7265 7266 /** 7267 * Adds an overlay on top of `[data-off-canvas-content]`.
7268 * @option 7269 * @type {boolean} 7270 * @default true 7271 */ 7272 contentOverlay: true, 7273 7274 /** 7275 * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken. 7276 * @option 7277 * @type {?string} 7278 * @default null 7279 */ 7280 contentId: null, 7281 7282 /** 7283 * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element. 7284 * @option 7285 * @type {boolean} 7286 * @default null 7287 */ 7288 nested: null, 7289 7290 /** 7291 * Enable/disable scrolling of the main content when an off canvas panel is open. 7292 * @option 7293 * @type {boolean} 7294 * @default true 7295 */ 7296 contentScroll: true, 7297 7298 /** 7299 * Amount of time in ms the open and close transition requires. If none selected, pulls from body style. 7300 * @option 7301 * @type {number} 7302 * @default null 7303 */ 7304 transitionTime: null, 7305 7306 /** 7307 * Type of transition for the offcanvas menu. Options are 'push', 'detached' or 'slide'. 7308 * @option 7309 * @type {string} 7310 * @default push 7311 */ 7312 transition: 'push', 7313 7314 /** 7315 * Force the page to scroll to top or bottom on open. 7316 * @option 7317 * @type {?string} 7318 * @default null 7319 */ 7320 forceTo: null, 7321 7322 /** 7323 * Allow the offcanvas to remain open for certain breakpoints. 7324 * @option 7325 * @type {boolean} 7326 * @default false 7327 */ 7328 isRevealed: false, 7329 7330 /** 7331 * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option. 7332 * @option 7333 * @type {?string} 7334 * @default null 7335 */ 7336 revealOn: null, 7337 7338 /** 7339 * Force focus to the offcanvas on open. If true, will focus the opening trigger on close.
vendor: 4,704 bytes, lines 7340-7439
7340 * @option 7341 * @type {boolean} 7342 * @default true 7343 */ 7344 autoFocus: true, 7345 7346 /** 7347 * Class used to force an offcanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`. 7348 * @option 7349 * @type {string} 7350 * @default reveal-for- 7351 * @todo improve the regex testing for this. 7352 */ 7353 revealClass: 'reveal-for-', 7354 7355 /** 7356 * Triggers optional focus trapping when opening an offcanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. 7357 * @option 7358 * @type {boolean} 7359 * @default false 7360 */ 7361 trapFocus: false 7362}; 7363 7364 7365 7366/***/ }), 7367/* 24 */ 7368/***/ (function(module, __webpack_exports__, __webpack_require__) { 7369 7370"use strict"; 7371/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Orbit; }); 7372/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 7373/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 7374/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 7375/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__ = __webpack_require__(6); 7376/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_timer__ = __webpack_require__(34); 7377/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_imageLoader__ = __webpack_require__(8); 7378/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_core__ = __webpack_require__(1); 7379/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_plugin__ = __webpack_require__(2); 7380/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__foundation_util_touch__ = __webpack_require__(16); 7381 7382 7383var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 7384 7385function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7386 7387function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 7388 7389function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400/** 7401 * Orbit module. 7402 * @module foundation.orbit 7403 * @requires foundation.util.keyboard 7404 * @requires foundation.util.motion 7405 * @requires foundation.util.timer 7406 * @requires foundation.util.imageLoader 7407 * @requires foundation.util.touch 7408 */ 7409 7410var Orbit = function (_Plugin) { 7411 _inherits(Orbit, _Plugin); 7412 7413 function Orbit() { 7414 _classCallCheck(this, Orbit); 7415 7416 return _possibleConstructorReturn(this, (Orbit.__proto__ || Object.getPrototypeOf(Orbit)).apply(this, arguments)); 7417 } 7418 7419 _createClass(Orbit, [{ 7420 key: '_setup', 7421 7422 /** 7423 * Creates a new instance of an orbit carousel. 7424 * @class 7425 * @name Orbit 7426 * @param {jQuery} element - jQuery object to make into an Orbit Carousel. 7427 * @param {Object} options - Overrides to the default plugin settings. 7428 */ 7429 value: function _setup(element, options) { 7430 this.$element = element; 7431 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Orbit.defaults, this.$element.data(), options); 7432 this.className = 'Orbit'; // ie9 back compat 7433 7434 __WEBPACK_IMPORTED_MODULE_7__foundation_util_touch__["a" /* Touch */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); // Touch init is idempotent, we just need to make sure it's initialied. 7435 7436 this._init(); 7437 7438 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Orbit', { 7439 'ltr': {
vendor: 12,958 bytes, lines 7440-7801
7440 'ARROW_RIGHT': 'next', 7441 'ARROW_LEFT': 'previous' 7442 }, 7443 'rtl': { 7444 'ARROW_LEFT': 'next', 7445 'ARROW_RIGHT': 'previous' 7446 } 7447 }); 7448 } 7449 7450 /** 7451 * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation. 7452 * @function 7453 * @private 7454 */ 7455 7456 }, { 7457 key: '_init', 7458 value: function _init() { 7459 // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide 7460 this._reset(); 7461 7462 this.$wrapper = this.$element.find('.' + this.options.containerClass); 7463 this.$slides = this.$element.find('.' + this.options.slideClass); 7464 7465 var $images = this.$element.find('img'), 7466 initActive = this.$slides.filter('.is-active'), 7467 id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__foundation_util_core__["a" /* GetYoDigits */])(6, 'orbit'); 7468 7469 this.$element.attr({ 7470 'data-resize': id, 7471 'id': id 7472 }); 7473 7474 if (!initActive.length) { 7475 this.$slides.eq(0).addClass('is-active'); 7476 } 7477 7478 if (!this.options.useMUI) { 7479 this.$slides.addClass('no-motionui'); 7480 } 7481 7482 if ($images.length) { 7483 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__foundation_util_imageLoader__["a" /* onImagesLoaded */])($images, this._prepareForOrbit.bind(this)); 7484 } else { 7485 this._prepareForOrbit(); //hehe 7486 } 7487 7488 if (this.options.bullets) { 7489 this._loadBullets(); 7490 } 7491 7492 this._events(); 7493 7494 if (this.options.autoPlay && this.$slides.length > 1) { 7495 this.geoSync(); 7496 } 7497 7498 if (this.options.accessible) { 7499 // allow wrapper to be focusable to enable arrow navigation 7500 this.$wrapper.attr('tabindex', 0); 7501 } 7502 } 7503 7504 /** 7505 * Creates a jQuery collection of bullets, if they are being used. 7506 * @function 7507 * @private 7508 */ 7509 7510 }, { 7511 key: '_loadBullets', 7512 value: function _loadBullets() { 7513 this.$bullets = this.$element.find('.' + this.options.boxOfBullets).find('button'); 7514 } 7515 7516 /** 7517 * Sets a `timer` object on the orbit, and starts the counter for the next slide. 7518 * @function 7519 */ 7520 7521 }, { 7522 key: 'geoSync', 7523 value: function geoSync() { 7524 var _this = this; 7525 this.timer = new __WEBPACK_IMPORTED_MODULE_3__foundation_util_timer__["a" /* Timer */](this.$element, { 7526 duration: this.options.timerDelay, 7527 infinite: false 7528 }, function () { 7529 _this.changeSlide(true); 7530 }); 7531 this.timer.start(); 7532 } 7533 7534 /** 7535 * Sets wrapper and slide heights for the orbit. 7536 * @function 7537 * @private 7538 */ 7539 7540 }, { 7541 key: '_prepareForOrbit', 7542 value: function _prepareForOrbit() { 7543 var _this = this; 7544 this._setWrapperHeight(); 7545 } 7546 7547 /** 7548 * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height. 7549 * @function 7550 * @private 7551 * @param {Function} cb - a callback function to fire when complete. 7552 */ 7553 7554 }, { 7555 key: '_setWrapperHeight', 7556 value: function _setWrapperHeight(cb) { 7557 //rewrite this to `for` loop 7558 var max = 0, 7559 temp, 7560 counter = 0, 7561 _this = this; 7562 7563 this.$slides.each(function () { 7564 temp = this.getBoundingClientRect().height; 7565 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('data-slide', counter); 7566 7567 if (!/mui/g.test(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) { 7568 //if not the active slide, set css position and display property 7569 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).css({ 'position': 'relative', 'display': 'none' }); 7570 } 7571 max = temp > max ? temp : max; 7572 counter++; 7573 }); 7574 7575 if (counter === this.$slides.length) { 7576 this.$wrapper.css({ 'height': max }); //only change the wrapper height property once. 7577 if (cb) { 7578 cb(max); 7579 } //fire callback with max height dimension. 7580 } 7581 } 7582 7583 /** 7584 * Sets the max-height of each slide. 7585 * @function 7586 * @private 7587 */ 7588 7589 }, { 7590 key: '_setSlideHeight', 7591 value: function _setSlideHeight(height) { 7592 this.$slides.each(function () { 7593 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).css('max-height', height); 7594 }); 7595 } 7596 7597 /** 7598 * Adds event listeners to basically everything within the element. 7599 * @function 7600 * @private 7601 */ 7602 7603 }, { 7604 key: '_events', 7605 value: function _events() { 7606 var _this = this; 7607 7608 //*************************************** 7609 //**Now using custom event - thanks to:** 7610 //** Yohai Ararat of Toronto ** 7611 //*************************************** 7612 // 7613 this.$element.off('.resizeme.zf.trigger').on({ 7614 'resizeme.zf.trigger': this._prepareForOrbit.bind(this) 7615 }); 7616 if (this.$slides.length > 1) { 7617 7618 if (this.options.swipe) { 7619 this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) { 7620 e.preventDefault(); 7621 _this.changeSlide(true); 7622 }).on('swiperight.zf.orbit', function (e) { 7623 e.preventDefault(); 7624 _this.changeSlide(false); 7625 }); 7626 } 7627 //*************************************** 7628 7629 if (this.options.autoPlay) { 7630 this.$slides.on('click.zf.orbit', function () { 7631 _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true); 7632 _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start'](); 7633 }); 7634 7635 if (this.options.pauseOnHover) { 7636 this.$element.on('mouseenter.zf.orbit', function () { 7637 _this.timer.pause(); 7638 }).on('mouseleave.zf.orbit', function () { 7639 if (!_this.$element.data('clickedOn')) { 7640 _this.timer.start(); 7641 } 7642 }); 7643 } 7644 } 7645 7646 if (this.options.navButtons) { 7647 var $controls = this.$element.find('.' + this.options.nextClass + ', .' + this.options.prevClass); 7648 $controls.attr('tabindex', 0) 7649 //also need to handle enter/return and spacebar key presses 7650 .on('click.zf.orbit touchend.zf.orbit', function (e) { 7651 e.preventDefault(); 7652 _this.changeSlide(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).hasClass(_this.options.nextClass)); 7653 }); 7654 } 7655 7656 if (this.options.bullets) { 7657 this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () { 7658 if (/is-active/g.test(this.className)) { 7659 return false; 7660 } //if this is active, kick out of function. 7661 var idx = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('slide'), 7662 ltr = idx > _this.$slides.filter('.is-active').data('slide'), 7663 $slide = _this.$slides.eq(idx); 7664 7665 _this.changeSlide(ltr, $slide, idx); 7666 }); 7667 } 7668 7669 if (this.options.accessible) { 7670 this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) { 7671 // handle keyboard event with keyboard util 7672 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Orbit', { 7673 next: function () { 7674 _this.changeSlide(true); 7675 }, 7676 previous: function () { 7677 _this.changeSlide(false); 7678 }, 7679 handled: function () { 7680 // if bullet is focused, make sure focus moves 7681 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).is(_this.$bullets)) { 7682 _this.$bullets.filter('.is-active').focus(); 7683 } 7684 } 7685 }); 7686 }); 7687 } 7688 } 7689 } 7690 7691 /** 7692 * Resets Orbit so it can be reinitialized 7693 */ 7694 7695 }, { 7696 key: '_reset', 7697 value: function _reset() { 7698 // Don't do anything if there are no slides (first run) 7699 if (typeof this.$slides == 'undefined') { 7700 return; 7701 } 7702 7703 if (this.$slides.length > 1) { 7704 // Remove old events 7705 this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); 7706 7707 // Restart timer if autoPlay is enabled 7708 if (this.options.autoPlay) { 7709 this.timer.restart(); 7710 } 7711 7712 // Reset all sliddes 7713 this.$slides.each(function (el) { 7714 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide(); 7715 }); 7716 7717 // Show the first slide 7718 this.$slides.first().addClass('is-active').show(); 7719 7720 // Triggers when the slide has finished animating 7721 this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); 7722 7723 // Select first bullet if bullets are present 7724 if (this.options.bullets) { 7725 this._updateBullets(0); 7726 } 7727 } 7728 } 7729 7730 /** 7731 * Changes the current slide to a new one. 7732 * @function 7733 * @param {Boolean} isLTR - flag if the slide should move left to right. 7734 * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected. 7735 * @param {Number} idx - the index of the new slide in its collection, if one chosen. 7736 * @fires Orbit#slidechange 7737 */ 7738 7739 }, { 7740 key: 'changeSlide', 7741 value: function changeSlide(isLTR, chosenSlide, idx) { 7742 if (!this.$slides) { 7743 return; 7744 } // Don't freak out if we're in the middle of cleanup 7745 var $curSlide = this.$slides.filter('.is-active').eq(0); 7746 7747 if (/mui/g.test($curSlide[0].className)) { 7748 return false; 7749 } //if the slide is currently animating, kick out of the function 7750 7751 var $firstSlide = this.$slides.first(), 7752 $lastSlide = this.$slides.last(), 7753 dirIn = isLTR ? 'Right' : 'Left', 7754 dirOut = isLTR ? 'Left' : 'Right', 7755 _this = this, 7756 $newSlide; 7757 7758 if (!chosenSlide) { 7759 //most of the time, this will be auto played or clicked from the navButtons. 7760 $newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!! 7761 this.options.infiniteWrap ? $curSlide.next('.' + this.options.slideClass).length ? $curSlide.next('.' + this.options.slideClass) : $firstSlide : $curSlide.next('.' + this.options.slideClass) : //pick next slide if moving left to right 7762 this.options.infiniteWrap ? $curSlide.prev('.' + this.options.slideClass).length ? $curSlide.prev('.' + this.options.slideClass) : $lastSlide : $curSlide.prev('.' + this.options.slideClass); //pick prev slide if moving right to left 7763 } else { 7764 $newSlide = chosenSlide; 7765 } 7766 7767 if ($newSlide.length) { 7768 /** 7769 * Triggers before the next slide starts animating in and only if a next slide has been found. 7770 * @event Orbit#beforeslidechange 7771 */ 7772 this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]); 7773 7774 if (this.options.bullets) { 7775 idx = idx || this.$slides.index($newSlide); //grab index to update bullets 7776 this._updateBullets(idx); 7777 } 7778 7779 if (this.options.useMUI && !this.$element.is(':hidden')) { 7780 __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["a" /* Motion */].animateIn($newSlide.addClass('is-active').css({ 'position': 'absolute', 'top': 0 }), this.options['animInFrom' + dirIn], function () { 7781 $newSlide.css({ 'position': 'relative', 'display': 'block' }).attr('aria-live', 'polite'); 7782 }); 7783 7784 __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["a" /* Motion */].animateOut($curSlide.removeClass('is-active'), this.options['animOutTo' + dirOut], function () { 7785 $curSlide.removeAttr('aria-live'); 7786 if (_this.options.autoPlay && !_this.timer.isPaused) { 7787 _this.timer.restart(); 7788 } 7789 //do stuff? 7790 }); 7791 } else { 7792 $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide(); 7793 $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show(); 7794 if (this.options.autoPlay && !this.timer.isPaused) { 7795 this.timer.restart(); 7796 } 7797 } 7798 /** 7799 * Triggers when the slide has finished animating in. 7800 * @event Orbit#slidechange 7801 */
7802 this.$element.trigger('slidechange.zf.orbit', [$newSlide]); 7803 } 7804 } 7805 7806 /** 7807 * Updates the active state of the bullets, if displayed. 7808 * @function 7809 * @private 7810 * @param {Number} idx - the index of the current slide. 7811 */ 7812 7813 }, { 7814 key: '_updateBullets', 7815 value: function _updateBullets(idx) { 7816 var $oldBullet = this.$element.find('.' + this.options.boxOfBullets).find('.is-active').removeClass('is-active').blur(), 7817 span = $oldBullet.find('span:last').detach(), 7818 $newBullet = this.$bullets.eq(idx).addClass('is-active').append(span); 7819 } 7820 7821 /** 7822 * Destroys the carousel and hides the element. 7823 * @function 7824 */ 7825 7826 }, { 7827 key: '_destroy', 7828 value: function _destroy() { 7829 this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide(); 7830 } 7831 }]); 7832 7833 return Orbit; 7834}(__WEBPACK_IMPORTED_MODULE_6__foundation_plugin__["a" /* Plugin */]); 7835 7836Orbit.defaults = { 7837 /** 7838 * Tells the JS to look for and loadBullets. 7839 * @option 7840 * @type {boolean} 7841 * @default true 7842 */ 7843 bullets: true, 7844 /** 7845 * Tells the JS to apply event listeners to nav buttons 7846 * @option 7847 * @type {boolean} 7848 * @default true 7849 */ 7850 navButtons: true, 7851 /** 7852 * motion-ui animation class to apply 7853 * @option 7854 * @type {string} 7855 * @default 'slide-in-right' 7856 */ 7857 animInFromRight: 'slide-in-right', 7858 /** 7859 * motion-ui animation class to apply 7860 * @option 7861 * @type {string} 7862 * @default 'slide-out-right' 7863 */ 7864 animOutToRight: 'slide-out-right', 7865 /** 7866 * motion-ui animation class to apply 7867 * @option 7868 * @type {string} 7869 * @default 'slide-in-left' 7870 * 7871 */ 7872 animInFromLeft: 'slide-in-left', 7873 /** 7874 * motion-ui animation class to apply 7875 * @option 7876 * @type {string} 7877 * @default 'slide-out-left' 7878 */ 7879 animOutToLeft: 'slide-out-left', 7880 /** 7881 * Allows Orbit to automatically animate on page load. 7882 * @option 7883 * @type {boolean} 7884 * @default true 7885 */ 7886 autoPlay: true, 7887 /** 7888 * Amount of time, in ms, between slide transitions 7889 * @option 7890 * @type {number} 7891 * @default 5000 7892 */ 7893 timerDelay: 5000, 7894 /** 7895 * Allows Orbit to infinitely loop through the slides 7896 * @option 7897 * @type {boolean} 7898 * @default true 7899 */ 7900 infiniteWrap: true, 7901 /** 7902 * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library 7903 * @option 7904 * @type {boolean} 7905 * @default true 7906 */ 7907 swipe: true, 7908 /** 7909 * Allows the timing function to pause animation on hover. 7910 * @option 7911 * @type {boolean} 7912 * @default true 7913 */ 7914 pauseOnHover: true, 7915 /** 7916 * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys 7917 * @option 7918 * @type {boolean} 7919 * @default true 7920 */ 7921 accessible: true, 7922 /** 7923 * Class applied to the container of Orbit 7924 * @option 7925 * @type {string} 7926 * @default 'orbit-container' 7927 */ 7928 containerClass: 'orbit-container', 7929 /** 7930 * Class applied to individual slides. 7931 * @option 7932 * @type {string} 7933 * @default 'orbit-slide' 7934 */ 7935 slideClass: 'orbit-slide', 7936 /** 7937 * Class applied to the bullet container. You're welcome. 7938 * @option 7939 * @type {string} 7940 * @default 'orbit-bullets' 7941 */ 7942 boxOfBullets: 'orbit-bullets', 7943 /** 7944 * Class applied to the `next` navigation button. 7945 * @option 7946 * @type {string} 7947 * @default 'orbit-next' 7948 */ 7949 nextClass: 'orbit-next', 7950 /** 7951 * Class applied to the `previous` navigation button. 7952 * @option 7953 * @type {string} 7954 * @default 'orbit-previous' 7955 */ 7956 prevClass: 'orbit-previous', 7957 /** 7958 * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatability. 7959 * @option 7960 * @type {boolean} 7961 * @default true 7962 */ 7963 useMUI: true 7964}; 7965 7966 7967 7968/***/ }), 7969/* 25 */ 7970/***/ (function(module, __webpack_exports__, __webpack_require__) { 7971 7972"use strict"; 7973/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveAccordionTabs; }); 7974/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 7975/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 7976/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(3); 7977/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(1); 7978/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2); 7979/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_accordion__ = __webpack_require__(10); 7980/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_tabs__ = __webpack_require__(14); 7981 7982 7983var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 7984 7985function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7986 7987function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 7988 7989function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
7989onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999// The plugin matches the plugin classes with these plugin instances. 8000var MenuPlugins = { 8001 tabs: { 8002 cssClass: 'tabs', 8003 plugin: __WEBPACK_IMPORTED_MODULE_5__foundation_tabs__["a" /* Tabs */] 8004 }, 8005 accordion: { 8006 cssClass: 'accordion', 8007 plugin: __WEBPACK_IMPORTED_MODULE_4__foundation_accordion__["a" /* Accordion */] 8008 } 8009}; 8010 8011/** 8012 * ResponsiveAccordionTabs module. 8013 * @module foundation.responsiveAccordionTabs 8014 * @requires foundation.util.motion 8015 * @requires foundation.accordion 8016 * @requires foundation.tabs 8017 */ 8018 8019var ResponsiveAccordionTabs = function (_Plugin) { 8020 _inherits(ResponsiveAccordionTabs, _Plugin); 8021 8022 function ResponsiveAccordionTabs() { 8023 _classCallCheck(this, ResponsiveAccordionTabs); 8024 8025 return _possibleConstructorReturn(this, (ResponsiveAccordionTabs.__proto__ || Object.getPrototypeOf(ResponsiveAccordionTabs)).apply(this, arguments)); 8026 } 8027 8028 _createClass(ResponsiveAccordionTabs, [{ 8029 key: '_setup', 8030 8031 /** 8032 * Creates a new instance of a responsive accordion tabs. 8033 * @class 8034 * @name ResponsiveAccordionTabs 8035 * @fires ResponsiveAccordionTabs#init 8036 * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs. 8037 * @param {Object} options - Overrides to the default plugin settings. 8038 */ 8039 value: function _setup(element, options) { 8040 this.$element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element); 8041 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, this.$element.data(), options); 8042 this.rules = this.$element.data('responsive-accordion-tabs'); 8043 this.currentMq = null; 8044 this.currentPlugin = null; 8045 this.className = 'ResponsiveAccordionTabs'; // ie9 back compat 8046 if (!this.$element.attr('id')) { 8047 this.$element.attr('id', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["a" /* GetYoDigits */])(6, 'responsiveaccordiontabs')); 8048 }; 8049 8050 this._init(); 8051 this._events(); 8052 } 8053 8054 /** 8055 * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element. 8056 * @function 8057 * @private 8058 */ 8059 8060 }, { 8061 key: '_init', 8062 value: function _init() { 8063 __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 8064 8065 // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules 8066 if (typeof this.rules === 'string') { 8067 var rulesTree = {}; 8068 8069 // Parse rules from "classes" pulled from data attribute 8070 var rules = this.rules.split(' '); 8071 8072 // Iterate through every rule found 8073 for (var i = 0; i < rules.length; i++) { 8074 var rule = rules[i].split('-'); 8075 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 8076 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 8077 8078 if (MenuPlugins[rulePlugin] !== null) { 8079 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 8080 } 8081 } 8082 8083 this.rules = rulesTree; 8084 } 8085 8086 this._getAllOptions(); 8087 8088 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.isEmptyObject(this.rules)) { 8089 this._checkMediaQueries(); 8090 } 8091 } 8092 }, { 8093 key: '_getAllOptions', 8094 value: function _getAllOptions() { 8095 //get all defaults and options 8096 var _this = this; 8097 _this.allOptions = {}; 8098 for (var key in MenuPlugins) { 8099 if (MenuPlugins.hasOwnProperty(key)) { 8100 var obj = MenuPlugins[key]; 8101 try { 8102 var dummyPlugin = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<ul></ul>'); 8103 var tmpPlugin = new obj.plugin(dummyPlugin, _this.options); 8104 for (var keyKey in tmpPlugin.options) { 8105 if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') { 8106 var objObj = tmpPlugin.options[keyKey]; 8107 _this.allOptions[keyKey] = objObj; 8108 } 8109 } 8110 tmpPlugin.destroy(); 8111 } catch (e) {} 8112 } 8113 } 8114 } 8115 8116 /** 8117 * Initializes events for the Menu. 8118 * @function 8119 * @private 8120 */ 8121 8122 }, { 8123 key: '_events', 8124 value: function _events() { 8125 var _this = this; 8126 8127 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', function () { 8128 _this._checkMediaQueries(); 8129 }); 8130 } 8131 8132 /** 8133 * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out. 8134 * @function 8135 * @private 8136 */ 8137 8138 }, { 8139 key: '_checkMediaQueries', 8140 value: function _checkMediaQueries() { 8141 var matchedMq, 8142 _this = this; 8143 // Iterate through each rule and find the last matching rule 8144 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(this.rules, function (key) { 8145 if (__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].atLeast(key)) { 8146 matchedMq = key; 8147 } 8148 }); 8149 8150 // No match? No dice 8151 if (!matchedMq) return; 8152 8153 // Plugin already initialized? We good 8154 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; 8155 8156 // Remove existing plugin-specific CSS classes 8157 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(MenuPlugins, function (key, value) { 8158 _this.$element.removeClass(value.cssClass); 8159 }); 8160 8161 // Add the CSS class for the new plugin 8162 this.$element.addClass(this.rules[matchedMq].cssClass); 8163 8164 // Create an instance of the new plugin 8165 if (this.currentPlugin) {
vendor: 7,417 bytes, lines 8166-8281
8166 //don't know why but on nested elements data zfPlugin get's lost 8167 if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData); 8168 this.currentPlugin.destroy(); 8169 } 8170 this._handleMarkup(this.rules[matchedMq].cssClass); 8171 this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {}); 8172 this.storezfData = this.currentPlugin.$element.data('zfPlugin'); 8173 } 8174 }, { 8175 key: '_handleMarkup', 8176 value: function _handleMarkup(toSet) { 8177 var _this = this, 8178 fromString = 'accordion'; 8179 var $panels = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content=' + this.$element.attr('id') + ']'); 8180 if ($panels.length) fromString = 'tabs'; 8181 if (fromString === toSet) { 8182 return; 8183 }; 8184 8185 var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title'; 8186 var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel'; 8187 8188 this.$element.removeAttr('role'); 8189 var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item'); 8190 var $liHeadsA = $liHeads.children('a').removeClass('accordion-title'); 8191 8192 if (fromString === 'tabs') { 8193 $panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby'); 8194 $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected'); 8195 } else { 8196 $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content'); 8197 }; 8198 8199 $panels.css({ display: '', visibility: '' }); 8200 $liHeads.css({ display: '', visibility: '' }); 8201 if (toSet === 'accordion') { 8202 $panels.each(function (key, value) { 8203 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({ height: '' }); 8204 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach(); 8205 $liHeads.addClass('accordion-item').attr('data-accordion-item', ''); 8206 $liHeadsA.addClass('accordion-title'); 8207 }); 8208 } else if (toSet === 'tabs') { 8209 var $tabsContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content=' + _this.$element.attr('id') + ']'); 8210 var $placeholder = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#tabs-placeholder-' + _this.$element.attr('id')); 8211 if ($placeholder.length) { 8212 $tabsContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id')); 8213 $placeholder.remove(); 8214 } else { 8215 $tabsContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id')); 8216 }; 8217 $panels.each(function (key, value) { 8218 var tempValue = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).appendTo($tabsContent).addClass(tabsPanel); 8219 var hash = $liHeadsA.get(key).hash.slice(1); 8220 var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).attr('id') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["a" /* GetYoDigits */])(6, 'accordion'); 8221 if (hash !== id) { 8222 if (hash !== '') { 8223 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).attr('id', hash); 8224 } else { 8225 hash = id; 8226 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).attr('id', hash); 8227 __WEBPACK_IMPORTED_MODULE_0_jquery___default()($liHeadsA.get(key)).attr('href', __WEBPACK_IMPORTED_MODULE_0_jquery___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash); 8228 }; 8229 }; 8230 var isActive = __WEBPACK_IMPORTED_MODULE_0_jquery___default()($liHeads.get(key)).hasClass('is-active'); 8231 if (isActive) { 8232 tempValue.addClass('is-active'); 8233 }; 8234 }); 8235 $liHeads.addClass(tabsTitle); 8236 }; 8237 } 8238 8239 /** 8240 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 8241 * @function 8242 */ 8243 8244 }, { 8245 key: '_destroy', 8246 value: function _destroy() { 8247 if (this.currentPlugin) this.currentPlugin.destroy(); 8248 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('.zf.ResponsiveAccordionTabs'); 8249 } 8250 }]); 8251 8252 return ResponsiveAccordionTabs; 8253}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */]); 8254 8255ResponsiveAccordionTabs.defaults = {}; 8256 8257 8258 8259/***/ }), 8260/* 26 */ 8261/***/ (function(module, __webpack_exports__, __webpack_require__) { 8262 8263"use strict"; 8264/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveMenu; }); 8265/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 8266/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 8267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(3); 8268/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(1); 8269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2); 8270/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_dropdownMenu__ = __webpack_require__(13); 8271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_drilldown__ = __webpack_require__(12); 8272/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_accordionMenu__ = __webpack_require__(11); 8273 8274 8275var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 8276 8277function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8278 8279function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 8280 8281function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
8281onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293var MenuPlugins = { 8294 dropdown: { 8295 cssClass: 'dropdown', 8296 plugin: __WEBPACK_IMPORTED_MODULE_4__foundation_dropdownMenu__["a" /* DropdownMenu */] 8297 }, 8298 drilldown: { 8299 cssClass: 'drilldown', 8300 plugin: __WEBPACK_IMPORTED_MODULE_5__foundation_drilldown__["a" /* Drilldown */] 8301 }, 8302 accordion: { 8303 cssClass: 'accordion-menu', 8304 plugin: __WEBPACK_IMPORTED_MODULE_6__foundation_accordionMenu__["a" /* AccordionMenu */] 8305 } 8306}; 8307 8308// import "foundation.util.triggers.js"; 8309 8310 8311/** 8312 * ResponsiveMenu module. 8313 * @module foundation.responsiveMenu 8314 * @requires foundation.util.triggers 8315 * @requires foundation.util.mediaQuery 8316 */ 8317 8318var ResponsiveMenu = function (_Plugin) { 8319 _inherits(ResponsiveMenu, _Plugin); 8320 8321 function ResponsiveMenu() { 8322 _classCallCheck(this, ResponsiveMenu); 8323 8324 return _possibleConstructorReturn(this, (ResponsiveMenu.__proto__ || Object.getPrototypeOf(ResponsiveMenu)).apply(this, arguments)); 8325 } 8326 8327 _createClass(ResponsiveMenu, [{ 8328 key: '_setup', 8329 8330 /** 8331 * Creates a new instance of a responsive menu. 8332 * @class 8333 * @name ResponsiveMenu 8334 * @fires ResponsiveMenu#init 8335 * @param {jQuery} element - jQuery object to make into a dropdown menu. 8336 * @param {Object} options - Overrides to the default plugin settings. 8337 */ 8338 value: function _setup(element, options) { 8339 this.$element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element); 8340 this.rules = this.$element.data('responsive-menu'); 8341 this.currentMq = null; 8342 this.currentPlugin = null; 8343 this.className = 'ResponsiveMenu'; // ie9 back compat 8344 8345 this._init(); 8346 this._events(); 8347 } 8348 8349 /** 8350 * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element. 8351 * @function 8352 * @private 8353 */ 8354 8355 }, { 8356 key: '_init', 8357 value: function _init() { 8358 8359 __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 8360 // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules 8361 if (typeof this.rules === 'string') { 8362 var rulesTree = {}; 8363 8364 // Parse rules from "classes" pulled from data attribute 8365 var rules = this.rules.split(' '); 8366 8367 // Iterate through every rule found 8368 for (var i = 0; i < rules.length; i++) { 8369 var rule = rules[i].split('-'); 8370 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 8371 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 8372 8373 if (MenuPlugins[rulePlugin] !== null) { 8374 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 8375 } 8376 } 8377 8378 this.rules = rulesTree; 8379 } 8380 8381 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.isEmptyObject(this.rules)) { 8382 this._checkMediaQueries(); 8383 } 8384 // Add data-mutate since children may need it. 8385 this.$element.attr('data-mutate', this.$element.attr('data-mutate') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["a" /* GetYoDigits */])(6, 'responsive-menu')); 8386 } 8387 8388 /** 8389 * Initializes events for the Menu. 8390 * @function 8391 * @private 8392 */ 8393 8394 }, { 8395 key: '_events', 8396 value: function _events() { 8397 var _this = this; 8398 8399 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', function () { 8400 _this._checkMediaQueries(); 8401 }); 8402 // $(window).on('resize.zf.ResponsiveMenu', function() { 8403 // _this._checkMediaQueries(); 8404 // }); 8405 } 8406 8407 /** 8408 * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out. 8409 * @function 8410 * @private 8411 */ 8412 8413 }, { 8414 key: '_checkMediaQueries', 8415 value: function _checkMediaQueries() { 8416 var matchedMq, 8417 _this = this; 8418 // Iterate through each rule and find the last matching rule 8419 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(this.rules, function (key) { 8420 if (__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].atLeast(key)) { 8421 matchedMq = key; 8422 } 8423 }); 8424 8425 // No match? No dice 8426 if (!matchedMq) return; 8427 8428 // Plugin already initialized? We good 8429 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; 8430 8431 // Remove existing plugin-specific CSS classes 8432 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(MenuPlugins, function (key, value) { 8433 _this.$element.removeClass(value.cssClass); 8434 }); 8435 8436 // Add the CSS class for the new plugin 8437 this.$element.addClass(this.rules[matchedMq].cssClass); 8438 8439 // Create an instance of the new plugin 8440 if (this.currentPlugin) this.currentPlugin.destroy(); 8441 this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {}); 8442 } 8443 8444 /** 8445 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 8446 * @function 8447 */ 8448 8449 }, { 8450 key: '_destroy', 8451 value: function _destroy() { 8452 this.currentPlugin.destroy(); 8453 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('.zf.ResponsiveMenu'); 8454 } 8455 }]); 8456 8457 return ResponsiveMenu; 8458}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */]); 8459 8460ResponsiveMenu.defaults = {}; 8461 8462 8463 8464/***/ }), 8465/* 27 */ 8466/***/ (function(module, __webpack_exports__, __webpack_require__) { 8467 8468"use strict"; 8469/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveToggle; }); 8470/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 8471/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 8472/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(3); 8473/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__ = __webpack_require__(6); 8474/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2); 8475 8476 8477var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 8478 8479function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8480 8481function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 8482 8483function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
8483onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 8484 8485 8486 8487 8488 8489 8490 8491/** 8492 * ResponsiveToggle module. 8493 * @module foundation.responsiveToggle 8494 * @requires foundation.util.mediaQuery 8495 * @requires foundation.util.motion 8496 */ 8497 8498var ResponsiveToggle = function (_Plugin) { 8499 _inherits(ResponsiveToggle, _Plugin); 8500 8501 function ResponsiveToggle() { 8502 _classCallCheck(this, ResponsiveToggle); 8503 8504 return _possibleConstructorReturn(this, (ResponsiveToggle.__proto__ || Object.getPrototypeOf(ResponsiveToggle)).apply(this, arguments)); 8505 } 8506 8507 _createClass(ResponsiveToggle, [{ 8508 key: '_setup', 8509 8510 /** 8511 * Creates a new instance of Tab Bar. 8512 * @class 8513 * @name ResponsiveToggle 8514 * @fires ResponsiveToggle#init 8515 * @param {jQuery} element - jQuery object to attach tab bar functionality to. 8516 * @param {Object} options - Overrides to the default plugin settings. 8517 */ 8518 value: function _setup(element, options) { 8519 this.$element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element); 8520 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options); 8521 this.className = 'ResponsiveToggle'; // ie9 back compat 8522 8523 this._init(); 8524 this._events(); 8525 } 8526 8527 /** 8528 * Initializes the tab bar by finding the target element, toggling element, and running update(). 8529 * @function 8530 * @private 8531 */ 8532 8533 }, { 8534 key: '_init', 8535 value: function _init() { 8536 __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 8537 var targetID = this.$element.data('responsive-toggle'); 8538 if (!targetID) { 8539 console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.'); 8540 } 8541 8542 this.$targetMenu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + targetID); 8543 this.$toggler = this.$element.find('[data-toggle]').filter(function () { 8544 var target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle'); 8545 return target === targetID || target === ""; 8546 }); 8547 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, this.options, this.$targetMenu.data()); 8548 8549 // If they were set, parse the animation classes 8550 if (this.options.animate) { 8551 var input = this.options.animate.split(' '); 8552 8553 this.animationIn = input[0]; 8554 this.animationOut = input[1] || null; 8555 } 8556 8557 this._update(); 8558 } 8559 8560 /** 8561 * Adds necessary event handlers for the tab bar to work. 8562 * @function 8563 * @private 8564 */ 8565 8566 }, { 8567 key: '_events', 8568 value: function _events() { 8569 var _this = this; 8570 8571 this._updateMqHandler = this._update.bind(this); 8572 8573 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', this._updateMqHandler); 8574 8575 this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this)); 8576 } 8577 8578 /** 8579 * Checks the current media query to determine if the tab bar should be visible or hidden. 8580 * @function 8581 * @private 8582 */ 8583 8584 }, { 8585 key: '_update', 8586 value: function _update() { 8587 // Mobile 8588 if (!__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].atLeast(this.options.hideFor)) { 8589 this.$element.show(); 8590 this.$targetMenu.hide(); 8591 } 8592 8593 // Desktop 8594 else { 8595 this.$element.hide(); 8596 this.$targetMenu.show(); 8597 } 8598 } 8599 8600 /** 8601 * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it. 8602 * @function 8603 * @fires ResponsiveToggle#toggled 8604 */ 8605 8606 }, { 8607 key: 'toggleMenu', 8608 value: function toggleMenu() { 8609 var _this3 = this; 8610 8611 if (!__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["a" /* MediaQuery */].atLeast(this.options.hideFor)) { 8612 /** 8613 * Fires when the element attached to the tab bar toggles. 8614 * @event ResponsiveToggle#toggled 8615 */ 8616 if (this.options.animate) { 8617 if (this.$targetMenu.is(':hidden')) { 8618 __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["a" /* Motion */].animateIn(this.$targetMenu, this.animationIn, function () { 8619 _this3.$element.trigger('toggled.zf.responsiveToggle'); 8620 _this3.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger'); 8621 }); 8622 } else { 8623 __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["a" /* Motion */].animateOut(this.$targetMenu, this.animationOut, function () { 8624 _this3.$element.trigger('toggled.zf.responsiveToggle'); 8625 }); 8626 } 8627 } else { 8628 this.$targetMenu.toggle(0); 8629 this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger'); 8630 this.$element.trigger('toggled.zf.responsiveToggle'); 8631 } 8632 } 8633 } 8634 }, { 8635 key: '_destroy', 8636 value: function _destroy() { 8637 this.$element.off('.zf.responsiveToggle'); 8638 this.$toggler.off('.zf.responsiveToggle'); 8639 8640 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('changed.zf.mediaquery', this._updateMqHandler); 8641 } 8642 }]); 8643 8644 return ResponsiveToggle; 8645}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */]); 8646 8647ResponsiveToggle.defaults = { 8648 /** 8649 * The breakpoint after which the menu is always shown, and the tab bar is hidden. 8650 * @option 8651 * @type {string} 8652 * @default 'medium' 8653 */ 8654 hideFor: 'medium', 8655 8656 /** 8657 * To decide if the toggle should be animated or not. 8658 * @option 8659 * @type {boolean} 8660 * @default false 8661 */ 8662 animate: false 8663}; 8664 8665 8666 8667/***/ }), 8668/* 28 */ 8669/***/ (function(module, __webpack_exports__, __webpack_require__) { 8670 8671"use strict"; 8672/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Reveal; }); 8673/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 8674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 8675/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 8676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(3); 8677/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__ = __webpack_require__(6); 8678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2); 8679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_triggers__ = __webpack_require__(5); 8680 8681 8682var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 8683 8684function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8685 8686function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 8687 8688function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
8688onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 8689 8690 8691 8692 8693 8694 8695 8696 8697/** 8698 * Reveal module. 8699 * @module foundation.reveal 8700 * @requires foundation.util.keyboard 8701 * @requires foundation.util.triggers 8702 * @requires foundation.util.mediaQuery 8703 * @requires foundation.util.motion if using animations 8704 */ 8705 8706var Reveal = function (_Plugin) { 8707 _inherits(Reveal, _Plugin); 8708 8709 function Reveal() { 8710 _classCallCheck(this, Reveal); 8711 8712 return _possibleConstructorReturn(this, (Reveal.__proto__ || Object.getPrototypeOf(Reveal)).apply(this, arguments)); 8713 } 8714 8715 _createClass(Reveal, [{ 8716 key: '_setup', 8717 8718 /** 8719 * Creates a new instance of Reveal. 8720 * @class 8721 * @name Reveal 8722 * @param {jQuery} element - jQuery object to use for the modal. 8723 * @param {Object} options - optional parameters. 8724 */ 8725 value: function _setup(element, options) { 8726 this.$element = element; 8727 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Reveal.defaults, this.$element.data(), options); 8728 this.className = 'Reveal'; // ie9 back compat 8729 this._init(); 8730 8731 // Triggers init is idempotent, just need to make sure it is initialized 8732 __WEBPACK_IMPORTED_MODULE_5__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 8733 8734 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Reveal', { 8735 'ESCAPE': 'close' 8736 }); 8737 } 8738 8739 /** 8740 * Initializes the modal by adding the overlay and close buttons, (if selected). 8741 * @private 8742 */ 8743 8744 }, { 8745 key: '_init', 8746 value: function _init() { 8747 __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 8748 this.id = this.$element.attr('id'); 8749 this.isActive = false; 8750 this.cached = { mq: __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */].current }; 8751 this.isMobile = mobileSniff(); 8752 8753 this.$anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-open="' + this.id + '"]').length ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-open="' + this.id + '"]') : __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-toggle="' + this.id + '"]'); 8754 this.$anchor.attr({ 8755 'aria-controls': this.id, 8756 'aria-haspopup': true, 8757 'tabindex': 0 8758 }); 8759 8760 if (this.options.fullScreen || this.$element.hasClass('full')) { 8761 this.options.fullScreen = true; 8762 this.options.overlay = false; 8763 } 8764 if (this.options.overlay && !this.$overlay) { 8765 this.$overlay = this._makeOverlay(this.id); 8766 } 8767 8768 this.$element.attr({ 8769 'role': 'dialog', 8770 'aria-hidden': true, 8771 'data-yeti-box': this.id, 8772 'data-resize': this.id 8773 }); 8774 8775 if (this.$overlay) { 8776 this.$element.detach().appendTo(this.$overlay); 8777 } else { 8778 this.$element.detach().appendTo(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.appendTo)); 8779 this.$element.addClass('without-overlay'); 8780 } 8781 this._events(); 8782 if (this.options.deepLink && window.location.hash === '#' + this.id) { 8783 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).one('load.zf.reveal', this.open.bind(this)); 8784 } 8785 } 8786 8787 /** 8788 * Creates an overlay div to display behind the modal. 8789 * @private 8790 */ 8791 8792 }, { 8793 key: '_makeOverlay', 8794 value: function _makeOverlay() { 8795 var additionalOverlayClasses = ''; 8796 8797 if (this.options.additionalOverlayClasses) { 8798 additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses; 8799 } 8800 8801 return __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<div></div>').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo); 8802 } 8803 8804 /** 8805 * Updates position of modal 8806 * TODO: Figure out if we actually need to cache these values or if it doesn't matter 8807 * @private 8808 */ 8809 8810 }, { 8811 key: '_updatePosition', 8812 value: function _updatePosition() { 8813 var width = this.$element.outerWidth(); 8814 var outerWidth = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).width(); 8815 var height = this.$element.outerHeight(); 8816 var outerHeight = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).height(); 8817 var left, top; 8818 if (this.options.hOffset === 'auto') { 8819 left = parseInt((outerWidth - width) / 2, 10); 8820 } else { 8821 left = parseInt(this.options.hOffset, 10); 8822 } 8823 if (this.options.vOffset === 'auto') { 8824 if (height > outerHeight) { 8825 top = parseInt(Math.min(100, outerHeight / 10), 10); 8826 } else { 8827 top = parseInt((outerHeight - height) / 4, 10); 8828 } 8829 } else { 8830 top = parseInt(this.options.vOffset, 10); 8831 } 8832 this.$element.css({ top: top + 'px' });
8833 // only worry about left if we don't have an overlay or we havea horizontal offset, 8834 // otherwise we're perfectly in the middle 8835 if (!this.$overlay || this.options.hOffset !== 'auto') { 8836 this.$element.css({ left: left + 'px' }); 8837 this.$element.css({ margin: '0px' }); 8838 } 8839 } 8840 8841 /** 8842 * Adds event handlers for the modal. 8843 * @private 8844 */ 8845 8846 }, { 8847 key: '_events', 8848 value: function _events() { 8849 var _this3 = this; 8850 8851 var _this = this; 8852 8853 this.$element.on({ 8854 'open.zf.trigger': this.open.bind(this), 8855 'close.zf.trigger': function (event, $element) { 8856 if (event.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default()(event.target).parents('[data-closable]')[0] === $element) { 8857 // only close reveal when it's explicitly called 8858 return _this3.close.apply(_this3); 8859 } 8860 }, 8861 'toggle.zf.trigger': this.toggle.bind(this), 8862 'resizeme.zf.trigger': function () { 8863 _this._updatePosition(); 8864 } 8865 }); 8866 8867 if (this.options.closeOnClick && this.options.overlay) { 8868 this.$overlay.off('.zf.reveal').on('click.zf.reveal', function (e) { 8869 if (e.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(_this.$element[0], e.target) || !__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(document, e.target)) { 8870 return; 8871 } 8872 _this.close(); 8873 }); 8874 } 8875 if (this.options.deepLink) { 8876 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate.zf.reveal:' + this.id, this._handleState.bind(this)); 8877 } 8878 } 8879 8880 /** 8881 * Handles modal methods on back/forward button clicks or any other event that triggers popstate. 8882 * @private 8883 */ 8884 8885 }, { 8886 key: '_handleState', 8887 value: function _handleState(e) { 8888 if (window.location.hash === '#' + this.id && !this.isActive) { 8889 this.open(); 8890 } else { 8891 this.close(); 8892 } 8893 } 8894 8895 /** 8896 * Opens the modal controlled by `this.$anchor`, and closes all others by default. 8897 * @function 8898 * @fires Reveal#closeme 8899 * @fires Reveal#open 8900 */ 8901 8902 }, { 8903 key: 'open', 8904 value: function open() { 8905 var _this4 = this; 8906 8907 // either update or replace browser history 8908 if (this.options.deepLink) { 8909 var hash = '#' + this.id; 8910 8911 if (window.history.pushState) { 8912 if (this.options.updateHistory) { 8913 window.history.pushState({}, '', hash); 8914 } else { 8915 window.history.replaceState({}, '', hash); 8916 } 8917 } else { 8918 window.location.hash = hash; 8919 } 8920 } 8921 8922 this.isActive = true; 8923 8924 // Make elements invisible, but remove display: none so we can get size and positioning 8925 this.$element.css({ 'visibility': 'hidden' }).show().scrollTop(0); 8926 if (this.options.overlay) { 8927 this.$overlay.css({ 'visibility': 'hidden' }).show(); 8928 } 8929 8930 this._updatePosition(); 8931 8932 this.$element.hide().css({ 'visibility': '' }); 8933 8934 if (this.$overlay) { 8935 this.$overlay.css({ 'visibility': '' }).hide(); 8936 if (this.$element.hasClass('fast')) { 8937 this.$overlay.addClass('fast'); 8938 } else if (this.$element.hasClass('slow')) { 8939 this.$overlay.addClass('slow'); 8940 } 8941 } 8942 8943 if (!this.options.multipleOpened) { 8944 /** 8945 * Fires immediately before the modal opens. 8946 * Closes any other modals that are currently open 8947 * @event Reveal#closeme 8948 */ 8949 this.$element.trigger('closeme.zf.reveal', this.id); 8950 } 8951 8952 var _this = this; 8953 8954 function addRevealOpenClasses() { 8955 if (_this.isMobile) { 8956 if (!_this.originalScrollPos) { 8957 _this.originalScrollPos = window.pageYOffset; 8958 } 8959 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').addClass('is-reveal-open'); 8960 } else { 8961 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').addClass('is-reveal-open'); 8962 } 8963 } 8964 // Motion UI method of reveal 8965 if (this.options.animationIn) { 8966 (function () { 8967 var afterAnimation = function () { 8968 _this.$element.attr({ 8969 'aria-hidden': false, 8970 'tabindex': -1 8971 }).focus(); 8972 addRevealOpenClasses(); 8973 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].trapFocus(_this.$element); 8974 }; 8975 8976 if (_this4.options.overlay) { 8977 __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["a" /* Motion */].animateIn(_this4.$overlay, 'fade-in'); 8978 } 8979 __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["a" /* Motion */].animateIn(_this4.$element, _this4.options.animationIn, function () { 8980 if (_this4.$element) { 8981 // protect against object having been removed 8982 _this4.focusableElements = __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].findFocusable(_this4.$element); 8983 afterAnimation(); 8984 } 8985 }); 8986 })(); 8987 } 8988 // jQuery method of reveal 8989 else { 8990 if (this.options.overlay) { 8991 this.$overlay.show(0); 8992 } 8993 this.$element.show(this.options.showDelay); 8994 } 8995 8996 // handle accessibility 8997 this.$element.attr({ 8998 'aria-hidden': false, 8999 'tabindex': -1 9000 }).focus(); 9001 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].trapFocus(this.$element); 9002 9003 addRevealOpenClasses(); 9004 9005 this._extraHandlers(); 9006 9007 /** 9008 * Fires when the modal has successfully opened. 9009 * @event Reveal#open 9010 */ 9011 this.$element.trigger('open.zf.reveal'); 9012 } 9013 9014 /** 9015 * Adds extra event handlers for the body and window if necessary. 9016 * @private 9017 */ 9018 9019 }, { 9020 key: '_extraHandlers', 9021 value: function _extraHandlers() { 9022 var _this = this; 9023 if (!this.$element) { 9024 return; 9025 } // If we're in the middle of cleanup, don't freak out 9026 this.focusableElements = __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].findFocusable(this.$element); 9027 9028 if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) { 9029 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').on('click.zf.reveal', function (e) { 9030 if (e.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(_this.$element[0], e.target) || !__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(document, e.target)) { 9031 return; 9032 } 9033 _this.close(); 9034 }); 9035 } 9036 9037 if (this.options.closeOnEsc) { 9038 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('keydown.zf.reveal', function (e) { 9039 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Reveal', { 9040 close: function () { 9041 if (_this.options.closeOnEsc) { 9042 _this.close(); 9043 } 9044 } 9045 }); 9046 }); 9047 } 9048 } 9049 9050 /** 9051 * Closes the modal. 9052 * @function 9053 * @fires Reveal#closed 9054 */ 9055 9056 }, { 9057 key: 'close', 9058 value: function close() { 9059 if (!this.isActive || !this.$element.is(':visible')) { 9060 return false; 9061 } 9062 var _this = this; 9063 9064 // Motion UI method of hiding 9065 if (this.options.animationOut) { 9066 if (this.options.overlay) { 9067 __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["a" /* Motion */].animateOut(this.$overlay, 'fade-out'); 9068 } 9069 9070 __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["a" /* Motion */].animateOut(this.$element, this.options.animationOut, finishUp); 9071 } 9072 // jQuery method of hiding 9073 else { 9074 this.$element.hide(this.options.hideDelay); 9075 9076 if (this.options.overlay) { 9077 this.$overlay.hide(0, finishUp); 9078 } else { 9079 finishUp(); 9080 } 9081 } 9082 9083 // Conditionals to remove extra event listeners added on open 9084 if (this.options.closeOnEsc) { 9085 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('keydown.zf.reveal'); 9086 } 9087 9088 if (!this.options.overlay && this.options.closeOnClick) { 9089 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').off('click.zf.reveal'); 9090 } 9091 9092 this.$element.off('keydown.zf.reveal'); 9093 9094 function finishUp() { 9095 if (_this.isMobile) { 9096 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.reveal:visible').length === 0) { 9097 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').removeClass('is-reveal-open'); 9098 } 9099 if (_this.originalScrollPos) { 9100 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').scrollTop(_this.originalScrollPos); 9101 _this.originalScrollPos = null; 9102 } 9103 } else { 9104 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.reveal:visible').length === 0) { 9105 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').removeClass('is-reveal-open'); 9106 } 9107 } 9108 9109 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].releaseFocus(_this.$element); 9110 9111 _this.$element.attr('aria-hidden', true); 9112 9113 /** 9114 * Fires when the modal is done closing. 9115 * @event Reveal#closed 9116 */ 9117 _this.$element.trigger('closed.zf.reveal'); 9118 } 9119 9120 /** 9121 * Resets the modal content 9122 * This prevents a running video to keep going in the background 9123 */ 9124 if (this.options.resetOnClose) { 9125 this.$element.html(this.$element.html()); 9126 } 9127 9128 this.isActive = false; 9129 if (_this.options.deepLink) { 9130 if (window.history.replaceState) { 9131 window.history.replaceState('', document.title, window.location.href.replace('#' + this.id, '')); 9132 } else { 9133 window.location.hash = ''; 9134 } 9135 } 9136 9137 this.$anchor.focus(); 9138 } 9139 9140 /** 9141 * Toggles the open/closed state of a modal. 9142 * @function 9143 */ 9144 9145 }, { 9146 key: 'toggle',
9147 value: function toggle() { 9148 if (this.isActive) { 9149 this.close(); 9150 } else { 9151 this.open(); 9152 } 9153 } 9154 }, { 9155 key: '_destroy', 9156 9157 9158 /** 9159 * Destroys an instance of a modal. 9160 * @function 9161 */ 9162 value: function _destroy() { 9163 if (this.options.overlay) { 9164 this.$element.appendTo(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin() 9165 this.$overlay.hide().off().remove(); 9166 } 9167 this.$element.hide().off(); 9168 this.$anchor.off('.zf'); 9169 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('.zf.reveal:' + this.id); 9170 } 9171 }]); 9172 9173 return Reveal; 9174}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["a" /* Plugin */]); 9175 9176Reveal.defaults = { 9177 /** 9178 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 9179 * @option 9180 * @type {string} 9181 * @default '' 9182 */ 9183 animationIn: '', 9184 /** 9185 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 9186 * @option 9187 * @type {string} 9188 * @default '' 9189 */ 9190 animationOut: '', 9191 /** 9192 * Time, in ms, to delay the opening of a modal after a click if no animation used. 9193 * @option 9194 * @type {number} 9195 * @default 0 9196 */ 9197 showDelay: 0, 9198 /** 9199 * Time, in ms, to delay the closing of a modal after a click if no animation used. 9200 * @option 9201 * @type {number} 9202 * @default 0 9203 */ 9204 hideDelay: 0, 9205 /** 9206 * Allows a click on the body/overlay to close the modal. 9207 * @option 9208 * @type {boolean} 9209 * @default true 9210 */ 9211 closeOnClick: true, 9212 /** 9213 * Allows the modal to close if the user presses the `ESCAPE` key. 9214 * @option 9215 * @type {boolean} 9216 * @default true 9217 */ 9218 closeOnEsc: true, 9219 /** 9220 * If true, allows multiple modals to be displayed at once. 9221 * @option 9222 * @type {boolean} 9223 * @default false 9224 */ 9225 multipleOpened: false, 9226 /** 9227 * Distance, in pixels, the modal should push down from the top of the screen. 9228 * @option 9229 * @type {number|string} 9230 * @default auto 9231 */ 9232 vOffset: 'auto', 9233 /** 9234 * Distance, in pixels, the modal should push in from the side of the screen. 9235 * @option 9236 * @type {number|string} 9237 * @default auto 9238 */ 9239 hOffset: 'auto', 9240 /** 9241 * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well. 9242 * @option 9243 * @type {boolean} 9244 * @default false 9245 */ 9246 fullScreen: false, 9247 /** 9248 * Percentage of screen height the modal should push up from the bottom of the view. 9249 * @option 9250 * @type {number} 9251 * @default 10 9252 */ 9253 btmOffsetPct: 10, 9254 /** 9255 * Allows the modal to generate an overlay div, which will cover the view when modal opens. 9256 * @option 9257 * @type {boolean} 9258 * @default true 9259 */ 9260 overlay: true, 9261 /** 9262 * Allows the modal to remove and reinject markup on close. Should be true if using video elements w/o using provider's api, otherwise, videos will continue to play in the background. 9263 * @option 9264 * @type {boolean} 9265 * @default false 9266 */ 9267 resetOnClose: false, 9268 /** 9269 * Allows the modal to alter the url on open/close, and allows the use of the `back` button to close modals. ALSO, allows a modal to auto-maniacally open on page load IF the hash === the modal's user-set id. 9270 * @option 9271 * @type {boolean} 9272 * @default false 9273 */ 9274 deepLink: false, 9275 /** 9276 * Update the browser history with the open modal 9277 * @option 9278 * @default false 9279 */ 9280 updateHistory: false, 9281 /** 9282 * Allows the modal to append to custom div. 9283 * @option 9284 * @type {string} 9285 * @default "body" 9286 */ 9287 appendTo: "body", 9288 /** 9289 * Allows adding additional class names to the reveal overlay. 9290 * @option 9291 * @type {string} 9292 * @default '' 9293 */ 9294 additionalOverlayClasses: '' 9295}; 9296 9297function iPhoneSniff() { 9298 return (/iP(ad|hone|od).*OS/.test(window.navigator.userAgent) 9299 ); 9300} 9301 9302function androidSniff() { 9303 return (/Android/.test(window.navigator.userAgent) 9304 ); 9305} 9306 9307function mobileSniff() { 9308 return iPhoneSniff() || androidSniff(); 9309} 9310 9311 9312 9313/***/ }), 9314/* 29 */ 9315/***/ (function(module, __webpack_exports__, __webpack_require__) { 9316 9317"use strict"; 9318/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Slider; }); 9319/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 9320/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 9321/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(4); 9322/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__ = __webpack_require__(6); 9323/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(1); 9324/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2); 9325/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_touch__ = __webpack_require__(16); 9326/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_util_triggers__ = __webpack_require__(5); 9327 9328 9329var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 9330 9331function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9332 9333function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 9334 9335function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
9335onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347/** 9348 * Slider module. 9349 * @module foundation.slider 9350 * @requires foundation.util.motion 9351 * @requires foundation.util.triggers 9352 * @requires foundation.util.keyboard 9353 * @requires foundation.util.touch 9354 */ 9355 9356var Slider = function (_Plugin) { 9357 _inherits(Slider, _Plugin); 9358 9359 function Slider() { 9360 _classCallCheck(this, Slider); 9361 9362 return _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).apply(this, arguments)); 9363 } 9364 9365 _createClass(Slider, [{ 9366 key: '_setup', 9367 9368 /** 9369 * Creates a new instance of a slider control. 9370 * @class 9371 * @name Slider 9372 * @param {jQuery} element - jQuery object to make into a slider control. 9373 * @param {Object} options - Overrides to the default plugin settings. 9374 */ 9375 value: function _setup(element, options) { 9376 this.$element = element; 9377 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Slider.defaults, this.$element.data(), options); 9378 this.className = 'Slider'; // ie9 back compat 9379 9380 // Touch and Triggers inits are idempotent, we just need to make sure it's initialied. 9381 __WEBPACK_IMPORTED_MODULE_5__foundation_util_touch__["a" /* Touch */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 9382 __WEBPACK_IMPORTED_MODULE_6__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 9383 9384 this._init(); 9385 9386 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].register('Slider', { 9387 'ltr': { 9388 'ARROW_RIGHT': 'increase', 9389 'ARROW_UP': 'increase', 9390 'ARROW_DOWN': 'decrease', 9391 'ARROW_LEFT': 'decrease', 9392 'SHIFT_ARROW_RIGHT': 'increase_fast', 9393 'SHIFT_ARROW_UP': 'increase_fast', 9394 'SHIFT_ARROW_DOWN': 'decrease_fast', 9395 'SHIFT_ARROW_LEFT': 'decrease_fast', 9396 'HOME': 'min', 9397 'END': 'max' 9398 }, 9399 'rtl': { 9400 'ARROW_LEFT': 'increase', 9401 'ARROW_RIGHT': 'decrease', 9402 'SHIFT_ARROW_LEFT': 'increase_fast', 9403 'SHIFT_ARROW_RIGHT': 'decrease_fast' 9404 } 9405 }); 9406 } 9407 9408 /** 9409 * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s). 9410 * @function 9411 * @private 9412 */ 9413 9414 }, { 9415 key: '_init', 9416 value: function _init() { 9417 this.inputs = this.$element.find('input'); 9418 this.handles = this.$element.find('[data-slider-handle]'); 9419 9420 this.$handle = this.handles.eq(0); 9421 this.$input = this.inputs.length ? this.inputs.eq(0) : __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + this.$handle.attr('aria-controls')); 9422 this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0); 9423 9424 var isDbl = false, 9425 _this = this; 9426 if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) { 9427 this.options.disabled = true; 9428 this.$element.addClass(this.options.disabledClass); 9429 } 9430 if (!this.inputs.length) { 9431 this.inputs = __WEBPACK_IMPORTED_MODULE_0_jquery___default()().add(this.$input); 9432 this.options.binding = true; 9433 } 9434 9435 this._setInitAttr(0); 9436 9437 if (this.handles[1]) { 9438 this.options.doubleSided = true; 9439 this.$handle2 = this.handles.eq(1); 9440 this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + this.$handle2.attr('aria-controls')); 9441 9442 if (!this.inputs[1]) { 9443 this.inputs = this.inputs.add(this.$input2); 9444 } 9445 isDbl = true; 9446 9447 // this.$handle.triggerHandler('click.zf.slider'); 9448 this._setInitAttr(1); 9449 } 9450 9451 // Set handle positions 9452 this.setHandles(); 9453 9454 this._events(); 9455 } 9456 }, { 9457 key: 'setHandles', 9458 value: function setHandles() { 9459 var _this3 = this; 9460 9461 if (this.handles[1]) { 9462 this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true, function () { 9463 _this3._setHandlePos(_this3.$handle2, _this3.inputs.eq(1).val(), true); 9464 }); 9465 } else { 9466 this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true); 9467 } 9468 } 9469 }, { 9470 key: '_reflow', 9471 value: function _reflow() { 9472 this.setHandles(); 9473 } 9474 /** 9475 * @function 9476 * @private 9477 * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value) 9478 */ 9479 9480 }, { 9481 key: '_pctOfBar',
9482 value: function _pctOfBar(value) { 9483 var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start); 9484 9485 switch (this.options.positionValueFunction) { 9486 case "pow": 9487 pctOfBar = this._logTransform(pctOfBar); 9488 break; 9489 case "log": 9490 pctOfBar = this._powTransform(pctOfBar); 9491 break; 9492 } 9493 9494 return pctOfBar.toFixed(2); 9495 } 9496 9497 /** 9498 * @function 9499 * @private 9500 * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value 9501 */ 9502 9503 }, { 9504 key: '_value', 9505 value: function _value(pctOfBar) { 9506 switch (this.options.positionValueFunction) { 9507 case "pow": 9508 pctOfBar = this._powTransform(pctOfBar); 9509 break; 9510 case "log": 9511 pctOfBar = this._logTransform(pctOfBar); 9512 break; 9513 } 9514 var value = (this.options.end - this.options.start) * pctOfBar + this.options.start; 9515 9516 return value; 9517 } 9518 9519 /** 9520 * @function 9521 * @private 9522 * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function 9523 */ 9524 9525 }, { 9526 key: '_logTransform',
vendor: 6,185 bytes, lines 9527-9655
9527 value: function _logTransform(value) { 9528 return baseLog(this.options.nonLinearBase, value * (this.options.nonLinearBase - 1) + 1); 9529 } 9530 9531 /** 9532 * @function 9533 * @private 9534 * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function 9535 */ 9536 9537 }, { 9538 key: '_powTransform', 9539 value: function _powTransform(value) { 9540 return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1); 9541 } 9542 9543 /** 9544 * Sets the position of the selected handle and fill bar. 9545 * @function 9546 * @private 9547 * @param {jQuery} $hndl - the selected handle to move. 9548 * @param {Number} location - floating point between the start and end values of the slider bar. 9549 * @param {Function} cb - callback function to fire on completion. 9550 * @fires Slider#moved 9551 * @fires Slider#changed 9552 */ 9553 9554 }, { 9555 key: '_setHandlePos', 9556 value: function _setHandlePos($hndl, location, noInvert, cb) { 9557 // don't move if the slider has been disabled since its initialization 9558 if (this.$element.hasClass(this.options.disabledClass)) { 9559 return; 9560 } 9561 //might need to alter that slightly for bars that will have odd number selections. 9562 location = parseFloat(location); //on input change events, convert string to number...grumble. 9563 9564 // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max 9565 if (location < this.options.start) { 9566 location = this.options.start; 9567 } else if (location > this.options.end) { 9568 location = this.options.end; 9569 } 9570 9571 var isDbl = this.options.doubleSided; 9572 9573 //this is for single-handled vertical sliders, it adjusts the value to account for the slider being "upside-down" 9574 //for click and drag events, it's weird due to the scale(-1, 1) css property 9575 if (this.options.vertical && !noInvert) { 9576 location = this.options.end - location; 9577 } 9578 9579 if (isDbl) { 9580 //this block is to prevent 2 handles from crossing eachother. Could/should be improved. 9581 if (this.handles.index($hndl) === 0) { 9582 var h2Val = parseFloat(this.$handle2.attr('aria-valuenow')); 9583 location = location >= h2Val ? h2Val - this.options.step : location; 9584 } else { 9585 var h1Val = parseFloat(this.$handle.attr('aria-valuenow')); 9586 location = location <= h1Val ? h1Val + this.options.step : location; 9587 } 9588 } 9589 9590 var _this = this, 9591 vert = this.options.vertical, 9592 hOrW = vert ? 'height' : 'width', 9593 lOrT = vert ? 'top' : 'left', 9594 handleDim = $hndl[0].getBoundingClientRect()[hOrW], 9595 elemDim = this.$element[0].getBoundingClientRect()[hOrW], 9596 9597 //percentage of bar min/max value based on click or drag point 9598 pctOfBar = this._pctOfBar(location), 9599 9600 //number of actual pixels to shift the handle, based on the percentage obtained above 9601 pxToMove = (elemDim - handleDim) * pctOfBar, 9602 9603 //percentage of bar to shift the handle 9604 movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal); 9605 //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value 9606 location = parseFloat(location.toFixed(this.options.decimal)); 9607 // declare empty object for css adjustments, only used with 2 handled-sliders 9608 var css = {}; 9609 9610 this._setValues($hndl, location); 9611 9612 // TODO update to calculate based on values set to respective inputs?? 9613 if (isDbl) { 9614 var isLeftHndl = this.handles.index($hndl) === 0, 9615 9616 //empty variable, will be used for min-height/width for fill bar 9617 dim, 9618 9619 //percentage w/h of the handle compared to the slider bar 9620 handlePct = ~~(percent(handleDim, elemDim) * 100); 9621 //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 9622 if (isLeftHndl) { 9623 //left or top percentage value to apply to the fill bar. 9624 css[lOrT] = movement + '%'; 9625 //calculate the new min-height/width for the fill bar. 9626 dim = parseFloat(this.$handle2[0].style[lOrT]) - movement + handlePct; 9627 //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider 9628 //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future. 9629 if (cb && typeof cb === 'function') { 9630 cb(); 9631 } //this is only needed for the initialization of 2 handled sliders 9632 } else { 9633 //just caching the value of the left/bottom handle's left/top property 9634 var handlePos = parseFloat(this.$handle[0].style[lOrT]); 9635 //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0 9636 //based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself 9637 dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start) / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct; 9638 } 9639 // assign the min-height/width to our css object 9640 css['min-' + hOrW] = dim + '%'; 9641 } 9642 9643 this.$element.one('finished.zf.animate', function () { 9644 /** 9645 * Fires when the handle is done moving. 9646 * @event Slider#moved 9647 */ 9648 _this.$element.trigger('moved.zf.slider', [$hndl]); 9649 }); 9650 9651 //because we don't know exactly how the handle will be moved, check the amount of time it should take to move. 9652 var moveTime = this.$element.data('dragging') ? 1000 / 60 : this.options.moveTime; 9653 9654 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["b" /* Move */])(moveTime, $hndl, function () { 9655 // adjusting the left/top property of the handle, based on the percentage c
vendor: 12,945 bytes, lines 9655-10057
9655alculated above 9656 // if movement isNaN, that is because the slider is hidden and we cannot determine handle width, 9657 // fall back to next best guess. 9658 if (isNaN(movement)) { 9659 $hndl.css(lOrT, pctOfBar * 100 + '%'); 9660 } else { 9661 $hndl.css(lOrT, movement + '%'); 9662 } 9663 9664 if (!_this.options.doubleSided) { 9665 //if single-handled, a simple method to expand the fill bar 9666 _this.$fill.css(hOrW, pctOfBar * 100 + '%'); 9667 } else { 9668 //otherwise, use the css object we created above 9669 _this.$fill.css(css); 9670 } 9671 }); 9672 9673 /** 9674 * Fires when the value has not been change for a given time. 9675 * @event Slider#changed 9676 */ 9677 clearTimeout(_this.timeout); 9678 _this.timeout = setTimeout(function () { 9679 _this.$element.trigger('changed.zf.slider', [$hndl]); 9680 }, _this.options.changedDelay); 9681 } 9682 9683 /** 9684 * Sets the initial attribute for the slider element. 9685 * @function 9686 * @private 9687 * @param {Number} idx - index of the current handle/input to use. 9688 */ 9689 9690 }, { 9691 key: '_setInitAttr', 9692 value: function _setInitAttr(idx) { 9693 var initVal = idx === 0 ? this.options.initialStart : this.options.initialEnd; 9694 var id = this.inputs.eq(idx).attr('id') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["a" /* GetYoDigits */])(6, 'slider'); 9695 this.inputs.eq(idx).attr({ 9696 'id': id, 9697 'max': this.options.end, 9698 'min': this.options.start, 9699 'step': this.options.step 9700 }); 9701 this.inputs.eq(idx).val(initVal); 9702 this.handles.eq(idx).attr({ 9703 'role': 'slider', 9704 'aria-controls': id, 9705 'aria-valuemax': this.options.end, 9706 'aria-valuemin': this.options.start, 9707 'aria-valuenow': initVal, 9708 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal', 9709 'tabindex': 0 9710 }); 9711 } 9712 9713 /** 9714 * Sets the input and `aria-valuenow` values for the slider element. 9715 * @function 9716 * @private 9717 * @param {jQuery} $handle - the currently selected handle. 9718 * @param {Number} val - floating point of the new value. 9719 */ 9720 9721 }, { 9722 key: '_setValues', 9723 value: function _setValues($handle, val) { 9724 var idx = this.options.doubleSided ? this.handles.index($handle) : 0; 9725 this.inputs.eq(idx).val(val); 9726 $handle.attr('aria-valuenow', val); 9727 } 9728 9729 /** 9730 * Handles events on the slider element. 9731 * Calculates the new location of the current handle. 9732 * If there are two handles and the bar was clicked, it determines which handle to move. 9733 * @function 9734 * @private 9735 * @param {Object} e - the `event` object passed from the listener. 9736 * @param {jQuery} $handle - the current handle to calculate for, if selected. 9737 * @param {Number} val - floating point number for the new value of the slider. 9738 * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn. 9739 */ 9740 9741 }, { 9742 key: '_handleEvent', 9743 value: function _handleEvent(e, $handle, val) { 9744 var value, hasVal; 9745 if (!val) { 9746 //click or drag events 9747 e.preventDefault(); 9748 var _this = this, 9749 vertical = this.options.vertical, 9750 param = vertical ? 'height' : 'width', 9751 direction = vertical ? 'top' : 'left', 9752 eventOffset = vertical ? e.pageY : e.pageX, 9753 halfOfHandle = this.$handle[0].getBoundingClientRect()[param] / 2, 9754 barDim = this.$element[0].getBoundingClientRect()[param], 9755 windowScroll = vertical ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop() : __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollLeft(); 9756 9757 var elemOffset = this.$element.offset()[direction]; 9758 9759 // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates... 9760 // best way to guess this is simulated is if clientY == pageY 9761 if (e.clientY === e.pageY) { 9762 eventOffset = eventOffset + windowScroll; 9763 } 9764 var eventFromBar = eventOffset - elemOffset; 9765 var barXY; 9766 if (eventFromBar < 0) { 9767 barXY = 0; 9768 } else if (eventFromBar > barDim) { 9769 barXY = barDim; 9770 } else { 9771 barXY = eventFromBar; 9772 } 9773 var offsetPct = percent(barXY, barDim); 9774 9775 value = this._value(offsetPct); 9776 9777 // turn everything around for RTL, yay math! 9778 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["b" /* rtl */])() && !this.options.vertical) { 9779 value = this.options.end - value; 9780 } 9781 9782 value = _this._adjustValue(null, value); 9783 //boolean flag for the setHandlePos fn, specifically for vertical sliders 9784 hasVal = false; 9785 9786 if (!$handle) { 9787 //figure out which handle it is, pass it to the next function. 9788 var firstHndlPos = absPosition(this.$handle, direction, barXY, param), 9789 secndHndlPos = absPosition(this.$handle2, direction, barXY, param); 9790 $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2; 9791 } 9792 } else { 9793 //change event on input 9794 value = this._adjustValue(null, val); 9795 hasVal = true; 9796 } 9797 9798 this._setHandlePos($handle, value, hasVal); 9799 } 9800 9801 /** 9802 * Adjustes value for handle in regard to step value. returns adjusted value 9803 * @function 9804 * @private 9805 * @param {jQuery} $handle - the selected handle. 9806 * @param {Number} value - value to adjust. used if $handle is falsy 9807 */ 9808 9809 }, { 9810 key: '_adjustValue', 9811 value: function _adjustValue($handle, value) { 9812 var val, 9813 step = this.options.step, 9814 div = parseFloat(step / 2), 9815 left, 9816 prev_val, 9817 next_val; 9818 if (!!$handle) { 9819 val = parseFloat($handle.attr('aria-valuenow')); 9820 } else { 9821 val = value; 9822 } 9823 left = val % step; 9824 prev_val = val - left; 9825 next_val = prev_val + step; 9826 if (left === 0) { 9827 return val; 9828 } 9829 val = val >= prev_val + div ? next_val : prev_val; 9830 return val; 9831 } 9832 9833 /** 9834 * Adds event listeners to the slider elements. 9835 * @function 9836 * @private 9837 */ 9838 9839 }, { 9840 key: '_events', 9841 value: function _events() { 9842 this._eventsForHandle(this.$handle); 9843 if (this.handles[1]) { 9844 this._eventsForHandle(this.$handle2); 9845 } 9846 } 9847 9848 /** 9849 * Adds event listeners a particular handle 9850 * @function 9851 * @private 9852 * @param {jQuery} $handle - the current handle to apply listeners to. 9853 */ 9854 9855 }, { 9856 key: '_eventsForHandle', 9857 value: function _eventsForHandle($handle) { 9858 var _this = this, 9859 curHandle, 9860 timer; 9861 9862 this.inputs.off('change.zf.slider').on('change.zf.slider', function (e) { 9863 var idx = _this.inputs.index(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)); 9864 _this._handleEvent(e, _this.handles.eq(idx), __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).val()); 9865 }); 9866 9867 if (this.options.clickSelect) { 9868 this.$element.off('click.zf.slider').on('click.zf.slider', function (e) { 9869 if (_this.$element.data('dragging')) { 9870 return false; 9871 } 9872 9873 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).is('[data-slider-handle]')) { 9874 if (_this.options.doubleSided) { 9875 _this._handleEvent(e); 9876 } else { 9877 _this._handleEvent(e, _this.$handle); 9878 } 9879 } 9880 }); 9881 } 9882 9883 if (this.options.draggable) { 9884 this.handles.addTouch(); 9885 9886 var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body'); 9887 $handle.off('mousedown.zf.slider').on('mousedown.zf.slider', function (e) { 9888 $handle.addClass('is-dragging'); 9889 _this.$fill.addClass('is-dragging'); // 9890 _this.$element.data('dragging', true); 9891 9892 curHandle = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.currentTarget); 9893 9894 $body.on('mousemove.zf.slider', function (e) { 9895 e.preventDefault(); 9896 _this._handleEvent(e, curHandle); 9897 }).on('mouseup.zf.slider', function (e) { 9898 _this._handleEvent(e, curHandle); 9899 9900 $handle.removeClass('is-dragging'); 9901 _this.$fill.removeClass('is-dragging'); 9902 _this.$element.data('dragging', false); 9903 9904 $body.off('mousemove.zf.slider mouseup.zf.slider'); 9905 }); 9906 }) 9907 // prevent events triggered by touch 9908 .on('selectstart.zf.slider touchmove.zf.slider', function (e) { 9909 e.preventDefault(); 9910 }); 9911 } 9912 9913 $handle.off('keydown.zf.slider').on('keydown.zf.slider', function (e) { 9914 var _$handle = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 9915 idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0, 9916 oldValue = parseFloat(_this.inputs.eq(idx).val()), 9917 newValue; 9918 9919 // handle keyboard event with keyboard util 9920 __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["a" /* Keyboard */].handleKey(e, 'Slider', { 9921 decrease: function () { 9922 newValue = oldValue - _this.options.step; 9923 }, 9924 increase: function () { 9925 newValue = oldValue + _this.options.step; 9926 }, 9927 decrease_fast: function () { 9928 newValue = oldValue - _this.options.step * 10; 9929 }, 9930 increase_fast: function () { 9931 newValue = oldValue + _this.options.step * 10; 9932 }, 9933 min: function () { 9934 newValue = _this.options.start; 9935 }, 9936 max: function () { 9937 newValue = _this.options.end; 9938 }, 9939 handled: function () { 9940 // only set handle pos when event was handled specially 9941 e.preventDefault(); 9942 _this._setHandlePos(_$handle, newValue, true); 9943 } 9944 }); 9945 /*if (newValue) { // if pressed key has special function, update value 9946 e.preventDefault(); 9947 _this._setHandlePos(_$handle, newValue); 9948 }*/ 9949 }); 9950 } 9951 9952 /** 9953 * Destroys the slider plugin. 9954 */ 9955 9956 }, { 9957 key: '_destroy', 9958 value: function _destroy() { 9959 this.handles.off('.zf.slider'); 9960 this.inputs.off('.zf.slider'); 9961 this.$element.off('.zf.slider'); 9962 9963 clearTimeout(this.timeout); 9964 } 9965 }]); 9966 9967 return Slider; 9968}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["a" /* Plugin */]); 9969 9970Slider.defaults = { 9971 /** 9972 * Minimum value for the slider scale. 9973 * @option 9974 * @type {number} 9975 * @default 0 9976 */ 9977 start: 0, 9978 /** 9979 * Maximum value for the slider scale. 9980 * @option 9981 * @type {number} 9982 * @default 100 9983 */ 9984 end: 100, 9985 /** 9986 * Minimum value change per change event. 9987 * @option 9988 * @type {number} 9989 * @default 1 9990 */ 9991 step: 1, 9992 /** 9993 * Value at which the handle/input *(left handle/first input)* should be set to on initialization. 9994 * @option 9995 * @type {number} 9996 * @default 0 9997 */ 9998 initialStart: 0, 9999 /** 10000 * Value at which the right handle/second input should be set to on initialization. 10001 * @option 10002 * @type {number} 10003 * @default 100 10004 */ 10005 initialEnd: 100, 10006 /** 10007 * Allows the input to be located outside the container and visible. Set to by the JS 10008 * @option 10009 * @type {boolean} 10010 * @default false 10011 */ 10012 binding: false, 10013 /** 10014 * Allows the user to click/tap on the slider bar to select a value. 10015 * @option 10016 * @type {boolean} 10017 * @default true 10018 */ 10019 clickSelect: true, 10020 /** 10021 * Set to true and use the `vertical` class to change alignment to vertical. 10022 * @option 10023 * @type {boolean} 10024 * @default false 10025 */ 10026 vertical: false, 10027 /** 10028 * Allows the user to drag the slider handle(s) to select a value. 10029 * @option 10030 * @type {boolean} 10031 * @default true 10032 */ 10033 draggable: true, 10034 /** 10035 * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`. 10036 * @option 10037 * @type {boolean} 10038 * @default false 10039 */ 10040 disabled: false, 10041 /** 10042 * Allows the use of two handles. Double checked by the JS. Changes some logic handling. 10043 * @option 10044 * @type {boolean} 10045 * @default false 10046 */ 10047 doubleSided: false, 10048 /** 10049 * Potential future feature. 10050 */ 10051 // steps: 100, 10052 /** 10053 * Number of decimal places the plugin should go to for floating point precision. 10054 * @option 10055 * @type {number} 10056 * @default 2 10057 */
vendor: 5,131 bytes, lines 10058-10179
10058 decimal: 2, 10059 /** 10060 * Time delay for dragged elements. 10061 */ 10062 // dragDelay: 0, 10063 /** 10064 * Time, in ms, to animate the movement of a slider handle if user clicks/taps on the bar. Needs to be manually set if updating the transition time in the Sass settings. 10065 * @option 10066 * @type {number} 10067 * @default 200 10068 */ 10069 moveTime: 200, //update this if changing the transition time in the sass 10070 /** 10071 * Class applied to disabled sliders. 10072 * @option 10073 * @type {string} 10074 * @default 'disabled' 10075 */ 10076 disabledClass: 'disabled', 10077 /** 10078 * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider. 10079 * @option 10080 * @type {boolean} 10081 * @default false 10082 */ 10083 invertVertical: false, 10084 /** 10085 * Milliseconds before the `changed.zf-slider` event is triggered after value change. 10086 * @option 10087 * @type {number} 10088 * @default 500 10089 */ 10090 changedDelay: 500, 10091 /** 10092 * Basevalue for non-linear sliders 10093 * @option 10094 * @type {number} 10095 * @default 5 10096 */ 10097 nonLinearBase: 5, 10098 /** 10099 * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting. 10100 * @option 10101 * @type {string} 10102 * @default 'linear' 10103 */ 10104 positionValueFunction: 'linear' 10105}; 10106 10107function percent(frac, num) { 10108 return frac / num; 10109} 10110function absPosition($handle, dir, clickPos, param) { 10111 return Math.abs($handle.position()[dir] + $handle[param]() / 2 - clickPos); 10112} 10113function baseLog(base, value) { 10114 return Math.log(value) / Math.log(base); 10115} 10116 10117 10118 10119/***/ }), 10120/* 30 */ 10121/***/ (function(module, __webpack_exports__, __webpack_require__) { 10122 10123"use strict"; 10124/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Sticky; }); 10125/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 10126/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 10127/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 10128/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(3); 10129/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2); 10130/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_triggers__ = __webpack_require__(5); 10131 10132 10133var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 10134 10135function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10136 10137function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 10138 10139function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10140 10141 10142 10143 10144 10145 10146 10147/** 10148 * Sticky module. 10149 * @module foundation.sticky 10150 * @requires foundation.util.triggers 10151 * @requires foundation.util.mediaQuery 10152 */ 10153 10154var Sticky = function (_Plugin) { 10155 _inherits(Sticky, _Plugin); 10156 10157 function Sticky() { 10158 _classCallCheck(this, Sticky); 10159 10160 return _possibleConstructorReturn(this, (Sticky.__proto__ || Object.getPrototypeOf(Sticky)).apply(this, arguments)); 10161 } 10162 10163 _createClass(Sticky, [{ 10164 key: '_setup', 10165 10166 /** 10167 * Creates a new instance of a sticky thing. 10168 * @class 10169 * @name Sticky 10170 * @param {jQuery} element - jQuery object to make sticky. 10171 * @param {Object} options - options object passed when creating the element programmatically. 10172 */ 10173 value: function _setup(element, options) { 10174 this.$element = element; 10175 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Sticky.defaults, this.$element.data(), options); 10176 this.className = 'Sticky'; // ie9 back compat 10177 10178 // Triggers init is idempotent, just need to make sure it is initialized 10179 __WEBPACK_IMPORTED_MODULE_4__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a);
vendor: 7,341 bytes, lines 10180-10412
10180 10181 this._init(); 10182 } 10183 10184 /** 10185 * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes 10186 * @function 10187 * @private 10188 */ 10189 10190 }, { 10191 key: '_init', 10192 value: function _init() { 10193 __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 10194 10195 var $parent = this.$element.parent('[data-sticky-container]'), 10196 id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["a" /* GetYoDigits */])(6, 'sticky'), 10197 _this = this; 10198 10199 if ($parent.length) { 10200 this.$container = $parent; 10201 } else { 10202 this.wasWrapped = true; 10203 this.$element.wrap(this.options.container); 10204 this.$container = this.$element.parent(); 10205 } 10206 this.$container.addClass(this.options.containerClass); 10207 10208 this.$element.addClass(this.options.stickyClass).attr({ 'data-resize': id, 'data-mutate': id }); 10209 if (this.options.anchor !== '') { 10210 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + _this.options.anchor).attr({ 'data-mutate': id }); 10211 } 10212 10213 this.scrollCount = this.options.checkEvery; 10214 this.isStuck = false; 10215 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).one('load.zf.sticky', function () { 10216 //We calculate the container height to have correct values for anchor points offset calculation. 10217 _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height; 10218 _this.$container.css('height', _this.containerHeight); 10219 _this.elemHeight = _this.containerHeight; 10220 if (_this.options.anchor !== '') { 10221 _this.$anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + _this.options.anchor); 10222 } else { 10223 _this._parsePoints(); 10224 } 10225 10226 _this._setSizes(function () { 10227 var scroll = window.pageYOffset; 10228 _this._calc(false, scroll); 10229 //Unstick the element will ensure that proper classes are set. 10230 if (!_this.isStuck) { 10231 _this._removeSticky(scroll >= _this.topPoint ? false : true); 10232 } 10233 }); 10234 _this._events(id.split('-').reverse().join('-')); 10235 }); 10236 } 10237 10238 /** 10239 * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on. 10240 * @function 10241 * @private 10242 */ 10243 10244 }, { 10245 key: '_parsePoints', 10246 value: function _parsePoints() { 10247 var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor, 10248 btm = this.options.btmAnchor == "" ? document.documentElement.scrollHeight : this.options.btmAnchor, 10249 pts = [top, btm], 10250 breaks = {}; 10251 for (var i = 0, len = pts.length; i < len && pts[i]; i++) { 10252 var pt; 10253 if (typeof pts[i] === 'number') { 10254 pt = pts[i]; 10255 } else { 10256 var place = pts[i].split(':'), 10257 anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + place[0]); 10258 10259 pt = anchor.offset().top; 10260 if (place[1] && place[1].toLowerCase() === 'bottom') { 10261 pt += anchor[0].getBoundingClientRect().height; 10262 } 10263 } 10264 breaks[i] = pt; 10265 } 10266 10267 this.points = breaks; 10268 return; 10269 } 10270 10271 /** 10272 * Adds event handlers for the scrolling element. 10273 * @private 10274 * @param {String} id - pseudo-random id for unique scroll event listener. 10275 */ 10276 10277 }, { 10278 key: '_events', 10279 value: function _events(id) { 10280 var _this = this, 10281 scrollListener = this.scrollListener = 'scroll.zf.' + id; 10282 if (this.isOn) { 10283 return; 10284 } 10285 if (this.canStick) { 10286 this.isOn = true; 10287 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(scrollListener).on(scrollListener, function (e) { 10288 if (_this.scrollCount === 0) { 10289 _this.scrollCount = _this.options.checkEvery; 10290 _this._setSizes(function () { 10291 _this._calc(false, window.pageYOffset); 10292 }); 10293 } else { 10294 _this.scrollCount--; 10295 _this._calc(false, window.pageYOffset); 10296 } 10297 }); 10298 } 10299 10300 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function (e, el) { 10301 _this._eventsHandler(id); 10302 }); 10303 10304 this.$element.on('mutateme.zf.trigger', function (e, el) { 10305 _this._eventsHandler(id); 10306 }); 10307 10308 if (this.$anchor) { 10309 this.$anchor.on('mutateme.zf.trigger', function (e, el) { 10310 _this._eventsHandler(id); 10311 }); 10312 } 10313 } 10314 10315 /** 10316 * Handler for events. 10317 * @private 10318 * @param {String} id - pseudo-random id for unique scroll event listener. 10319 */ 10320 10321 }, { 10322 key: '_eventsHandler', 10323 value: function _eventsHandler(id) { 10324 var _this = this, 10325 scrollListener = this.scrollListener = 'scroll.zf.' + id; 10326 10327 _this._setSizes(function () { 10328 _this._calc(false); 10329 if (_this.canStick) { 10330 if (!_this.isOn) { 10331 _this._events(id); 10332 } 10333 } else if (_this.isOn) { 10334 _this._pauseListeners(scrollListener); 10335 } 10336 }); 10337 } 10338 10339 /** 10340 * Removes event handlers for scroll and change events on anchor. 10341 * @fires Sticky#pause 10342 * @param {String} scrollListener - unique, namespaced scroll listener attached to `window` 10343 */ 10344 10345 }, { 10346 key: '_pauseListeners', 10347 value: function _pauseListeners(scrollListener) { 10348 this.isOn = false; 10349 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(scrollListener); 10350 10351 /** 10352 * Fires when the plugin is paused due to resize event shrinking the view. 10353 * @event Sticky#pause 10354 * @private 10355 */ 10356 this.$element.trigger('pause.zf.sticky'); 10357 } 10358 10359 /** 10360 * Called on every `scroll` event and on `_init` 10361 * fires functions based on booleans and cached values 10362 * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints. 10363 * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`. 10364 */ 10365 10366 }, { 10367 key: '_calc', 10368 value: function _calc(checkSizes, scroll) { 10369 if (checkSizes) { 10370 this._setSizes(); 10371 } 10372 10373 if (!this.canStick) { 10374 if (this.isStuck) { 10375 this._removeSticky(true); 10376 } 10377 return false; 10378 } 10379 10380 if (!scroll) { 10381 scroll = window.pageYOffset; 10382 } 10383 10384 if (scroll >= this.topPoint) { 10385 if (scroll <= this.bottomPoint) { 10386 if (!this.isStuck) { 10387 this._setSticky(); 10388 } 10389 } else { 10390 if (this.isStuck) { 10391 this._removeSticky(false); 10392 } 10393 } 10394 } else { 10395 if (this.isStuck) { 10396 this._removeSticky(true); 10397 } 10398 } 10399 } 10400 10401 /** 10402 * Causes the $element to become stuck. 10403 * Adds `position: fixed;`, and helper classes. 10404 * @fires Sticky#stuckto 10405 * @function 10406 * @private 10407 */ 10408 10409 }, { 10410 key: '_setSticky', 10411 value: function _setSticky() { 10412 var _this = this,
10413 stickTo = this.options.stickTo, 10414 mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom', 10415 notStuckTo = stickTo === 'top' ? 'bottom' : 'top', 10416 css = {}; 10417 10418 css[mrgn] = this.options[mrgn] + 'em'; 10419 css[stickTo] = 0; 10420 css[notStuckTo] = 'auto'; 10421 this.isStuck = true; 10422 this.$element.removeClass('is-anchored is-at-' + notStuckTo).addClass('is-stuck is-at-' + stickTo).css(css) 10423 /** 10424 * Fires when the $element has become `position: fixed;` 10425 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top` 10426 * @event Sticky#stuckto 10427 */ 10428 .trigger('sticky.zf.stuckto:' + stickTo); 10429 this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () { 10430 _this._setSizes(); 10431 }); 10432 } 10433 10434 /** 10435 * Causes the $element to become unstuck. 10436 * Removes `position: fixed;`, and helper classes. 10437 * Adds other helper classes. 10438 * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element. 10439 * @fires Sticky#unstuckfrom 10440 * @private 10441 */ 10442 10443 }, { 10444 key: '_removeSticky', 10445 value: function _removeSticky(isTop) { 10446 var stickTo = this.options.stickTo, 10447 stickToTop = stickTo === 'top', 10448 css = {}, 10449 anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight, 10450 mrgn = stickToTop ? 'marginTop' : 'marginBottom', 10451 notStuckTo = stickToTop ? 'bottom' : 'top', 10452 topOrBottom = isTop ? 'top' : 'bottom'; 10453 10454 css[mrgn] = 0; 10455 10456 css['bottom'] = 'auto'; 10457 if (isTop) { 10458 css['top'] = 0; 10459 } else { 10460 css['top'] = anchorPt; 10461 } 10462 10463 this.isStuck = false; 10464 this.$element.removeClass('is-stuck is-at-' + stickTo).addClass('is-anchored is-at-' + topOrBottom).css(css) 10465 /** 10466 * Fires when the $element has become anchored. 10467 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom` 10468 * @event Sticky#unstuckfrom 10469 */ 10470 .trigger('sticky.zf.unstuckfrom:' + topOrBottom); 10471 } 10472 10473 /** 10474 * Sets the $element and $container sizes for plugin. 10475 * Calls `_setBreakPoints`. 10476 * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`. 10477 * @private 10478 */ 10479 10480 }, { 10481 key: '_setSizes', 10482 value: function _setSizes(cb) { 10483 this.canStick = __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */].is(this.options.stickyOn); 10484 if (!this.canStick) { 10485 if (cb && typeof cb === 'function') { 10486 cb(); 10487 } 10488 } 10489 var _this = this, 10490 newElemWidth = this.$container[0].getBoundingClientRect().width, 10491 comp = window.getComputedStyle(this.$container[0]), 10492 pdngl = parseInt(comp['padding-left'], 10), 10493 pdngr = parseInt(comp['padding-right'], 10); 10494 10495 if (this.$anchor && this.$anchor.length) { 10496 this.anchorHeight = this.$anchor[0].getBoundingClientRect().height; 10497 } else { 10498 this._parsePoints(); 10499 } 10500 10501 this.$element.css({ 10502 'max-width': newElemWidth - pdngl - pdngr + 'px' 10503 }); 10504 10505 var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight; 10506 if (this.$element.css("display") == "none") { 10507 newContainerHeight = 0; 10508 } 10509 this.containerHeight = newContainerHeight; 10510 this.$container.css({ 10511 height: newContainerHeight 10512 }); 10513 this.elemHeight = newContainerHeight; 10514 10515 if (!this.isStuck) { 10516 if (this.$element.hasClass('is-at-bottom')) { 10517 var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight; 10518 this.$element.css('top', anchorPt); 10519 } 10520 } 10521 10522 this._setBreakPoints(newContainerHeight, function () { 10523 if (cb && typeof cb === 'function') { 10524 cb(); 10525 } 10526 }); 10527 } 10528 10529 /** 10530 * Sets the upper and lower breakpoints for the element to become sticky/unsticky. 10531 * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`. 10532 * @param {Function} cb - optional callback function to be called on completion. 10533 * @private 10534 */ 10535 10536 }, { 10537 key: '_setBreakPoints', 10538 value: function _setBreakPoints(elemHeight, cb) { 10539 if (!this.canStick) { 10540 if (cb && typeof cb === 'function') { 10541 cb(); 10542 } else { 10543 return false; 10544 } 10545 } 10546 var mTop = emCalc(this.options.marginTop), 10547 mBtm = emCalc(this.options.marginBottom), 10548 topPoint = this.points ? this.points[0] : this.$anchor.offset().top, 10549 bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight, 10550 10551 // topPoint = this.$anchor.offset().top || this.points[0], 10552 // bottomPoint = topPoint + this.anchorHeight || this.points[1], 10553 winHeight = window.innerHeight; 10554
10555 if (this.options.stickTo === 'top') { 10556 topPoint -= mTop; 10557 bottomPoint -= elemHeight + mTop; 10558 } else if (this.options.stickTo === 'bottom') { 10559 topPoint -= winHeight - (elemHeight + mBtm); 10560 bottomPoint -= winHeight - mBtm; 10561 } else { 10562 //this would be the stickTo: both option... tricky 10563 } 10564 10565 this.topPoint = topPoint; 10566 this.bottomPoint = bottomPoint; 10567 10568 if (cb && typeof cb === 'function') { 10569 cb(); 10570 } 10571 } 10572 10573 /** 10574 * Destroys the current sticky element. 10575 * Resets the element to the top position first. 10576 * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container. 10577 * @function 10578 */ 10579 10580 }, { 10581 key: '_destroy', 10582 value: function _destroy() { 10583 this._removeSticky(true); 10584 10585 this.$element.removeClass(this.options.stickyClass + ' is-anchored is-at-top').css({ 10586 height: '', 10587 top: '', 10588 bottom: '', 10589 'max-width': '' 10590 }).off('resizeme.zf.trigger').off('mutateme.zf.trigger'); 10591 if (this.$anchor && this.$anchor.length) { 10592 this.$anchor.off('change.zf.sticky'); 10593 } 10594 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(this.scrollListener); 10595 10596 if (this.wasWrapped) { 10597 this.$element.unwrap(); 10598 } else { 10599 this.$container.removeClass(this.options.containerClass).css({ 10600 height: '' 10601 }); 10602 } 10603 } 10604 }]); 10605 10606 return Sticky; 10607}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */]); 10608 10609Sticky.defaults = { 10610 /** 10611 * Customizable container template. Add your own classes for styling and sizing. 10612 * @option 10613 * @type {string} 10614 * @default '<div data-sticky-container></div>' 10615 */ 10616 container: '<div data-sticky-container></div>', 10617 /** 10618 * Location in the view the element sticks to. Can be `'top'` or `'bottom'`. 10619 * @option 10620 * @type {string} 10621 * @default 'top' 10622 */ 10623 stickTo: 'top', 10624 /** 10625 * If anchored to a single element, the id of that element. 10626 * @option 10627 * @type {string} 10628 * @default '' 10629 */ 10630 anchor: '', 10631 /** 10632 * If using more than one element as anchor points, the id of the top anchor. 10633 * @option 10634 * @type {string} 10635 * @default '' 10636 */ 10637 topAnchor: '', 10638 /** 10639 * If using more than one element as anchor points, the id of the bottom anchor. 10640 * @option 10641 * @type {string} 10642 * @default '' 10643 */ 10644 btmAnchor: '', 10645 /** 10646 * Margin, in `em`'s to apply to the top of the element when it becomes sticky. 10647 * @option 10648 * @type {number} 10649 * @default 1 10650 */ 10651 marginTop: 1, 10652 /** 10653 * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky. 10654 * @option 10655 * @type {number} 10656 * @default 1 10657 */ 10658 marginBottom: 1, 10659 /** 10660 * Breakpoint string that is the minimum screen size an element should become sticky. 10661 * @option 10662 * @type {string} 10663 * @default 'medium' 10664 */ 10665 stickyOn: 'medium', 10666 /** 10667 * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`. 10668 * @option 10669 * @type {string} 10670 * @default 'sticky' 10671 */ 10672 stickyClass: 'sticky', 10673 /** 10674 * Class applied to sticky container. Foundation defaults to `sticky-container`. 10675 * @option 10676 * @type {string} 10677 * @default 'sticky-container' 10678 */ 10679 containerClass: 'sticky-container', 10680 /** 10681 * Number of scroll events between the plugin's recalculating sticky points. Setting it to `0` will cause it to recalc every scroll event, setting it to `-1` will prevent recalc on scroll. 10682 * @option 10683 * @type {number} 10684 * @default -1 10685 */ 10686 checkEvery: -1 10687}; 10688 10689/** 10690 * Helper function to calculate em values 10691 * @param Number {em} - number of em's to calculate into pixels 10692 */ 10693function emCalc(em) { 10694 return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em; 10695} 10696 10697 10698 10699/***/ }), 10700/* 31 */ 10701/***/ (function(module, __webpack_exports__, __webpack_require__) { 10702 10703"use strict"; 10704/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Toggler; }); 10705/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 10706/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 10707/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__ = __webpack_require__(6); 10708/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2); 10709/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_triggers__ = __webpack_require__(5); 10710 10711 10712var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 10713 10714function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10715 10716function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 10717 10718function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
10718onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10719 10720 10721 10722 10723 10724 10725/** 10726 * Toggler module. 10727 * @module foundation.toggler 10728 * @requires foundation.util.motion 10729 * @requires foundation.util.triggers 10730 */ 10731 10732var Toggler = function (_Plugin) { 10733 _inherits(Toggler, _Plugin); 10734 10735 function Toggler() { 10736 _classCallCheck(this, Toggler); 10737 10738 return _possibleConstructorReturn(this, (Toggler.__proto__ || Object.getPrototypeOf(Toggler)).apply(this, arguments)); 10739 } 10740 10741 _createClass(Toggler, [{ 10742 key: '_setup', 10743 10744 /** 10745 * Creates a new instance of Toggler. 10746 * @class 10747 * @name Toggler 10748 * @fires Toggler#init 10749 * @param {Object} element - jQuery object to add the trigger to. 10750 * @param {Object} options - Overrides to the default plugin settings. 10751 */ 10752 value: function _setup(element, options) { 10753 this.$element = element; 10754 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Toggler.defaults, element.data(), options); 10755 this.className = ''; 10756 this.className = 'Toggler'; // ie9 back compat 10757 10758 // Triggers init is idempotent, just need to make sure it is initialized 10759 __WEBPACK_IMPORTED_MODULE_3__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 10760 10761 this._init(); 10762 this._events(); 10763 } 10764 10765 /** 10766 * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate. 10767 * @function 10768 * @private 10769 */ 10770 10771 }, { 10772 key: '_init', 10773 value: function _init() { 10774 var input; 10775 // Parse animation classes if they were set 10776 if (this.options.animate) { 10777 input = this.options.animate.split(' '); 10778 10779 this.animationIn = input[0]; 10780 this.animationOut = input[1] || null; 10781 } 10782 // Otherwise, parse toggle class 10783 else { 10784 input = this.$element.data('toggler'); 10785 // Allow for a . at the beginning of the string 10786 this.className = input[0] === '.' ? input.slice(1) : input; 10787 } 10788 10789 // Add ARIA attributes to triggers 10790 var id = this.$element[0].id; 10791 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-open="' + id + '"], [data-close="' + id + '"], [data-toggle="' + id + '"]').attr('aria-controls', id); 10792 // If the target is hidden, add aria-hidden 10793 this.$element.attr('aria-expanded', this.$element.is(':hidden') ? false : true); 10794 } 10795 10796 /** 10797 * Initializes events for the toggle trigger. 10798 * @function 10799 * @private 10800 */ 10801 10802 }, { 10803 key: '_events', 10804 value: function _events() { 10805 this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this)); 10806 } 10807 10808 /** 10809 * Toggles the target class on the target element. An event is fired from the original trigger depending on if the resultant state was "on" or "off". 10810 * @function 10811 * @fires Toggler#on 10812 * @fires Toggler#off 10813 */ 10814 10815 }, { 10816 key: 'toggle', 10817 value: function toggle() { 10818 this[this.options.animate ? '_toggleAnimate' : '_toggleClass'](); 10819 } 10820 }, { 10821 key: '_toggleClass', 10822 value: function _toggleClass() { 10823 this.$element.toggleClass(this.className); 10824 10825 var isOn = this.$element.hasClass(this.className); 10826 if (isOn) { 10827 /** 10828 * Fires if the target element has the class after a toggle. 10829 * @event Toggler#on 10830 */ 10831 this.$element.trigger('on.zf.toggler'); 10832 } else { 10833 /** 10834 * Fires if the target element does not have the class after a toggle. 10835 * @event Toggler#off 10836 */ 10837 this.$element.trigger('off.zf.toggler'); 10838 } 10839 10840 this._updateARIA(isOn); 10841 this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger'); 10842 } 10843 }, { 10844 key: '_toggleAnimate', 10845 value: function _toggleAnimate() { 10846 var _this = this; 10847 10848 if (this.$element.is(':hidden')) { 10849 __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["a" /* Motion */].animateIn(this.$element, this.animationIn, function () { 10850 _this._updateARIA(true); 10851 this.trigger('on.zf.toggler'); 10852 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 10853 }); 10854 } else { 10855 __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["a" /* Motion */].animateOut(this.$element, this.animationOut, function () { 10856 _this._updateARIA(false); 10857 this.trigger('off.zf.toggler'); 10858 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 10859 }); 10860 } 10861 } 10862 }, { 10863 key: '_updateARIA', 10864 value: function _updateARIA(isOn) { 10865 this.$element.attr('aria-expanded', isOn ? true : false); 10866 } 10867 10868 /** 10869 * Destroys the instance of Toggler on the element. 10870 * @function 10871 */ 10872 10873 }, { 10874 key: '_destroy', 10875 value: function _destroy() { 10876 this.$element.off('.zf.toggler'); 10877 } 10878 }]); 10879 10880 return Toggler; 10881}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["a" /* Plugin */]); 10882 10883Toggler.defaults = { 10884 /** 10885 * Tells the plugin if the element should animated when toggled. 10886 * @option 10887 * @type {boolean} 10888 * @default false 10889 */ 10890 animate: false 10891}; 10892 10893 10894 10895/***/ }), 10896/* 32 */ 10897/***/ (function(module, __webpack_exports__, __webpack_require__) { 10898 10899"use strict"; 10900/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Tooltip; }); 10901/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 10902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 10903/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 10904/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(3); 10905/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_triggers__ = __webpack_require__(5); 10906/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_positionable__ = __webpack_require__(15); 10907 10908 10909var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 10910 10911var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; 10912 10913function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10914 10915function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 10916 10917function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
10917onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 10918 10919 10920 10921 10922 10923 10924 10925 10926/** 10927 * Tooltip module. 10928 * @module foundation.tooltip 10929 * @requires foundation.util.box 10930 * @requires foundation.util.mediaQuery 10931 * @requires foundation.util.triggers 10932 */ 10933 10934var Tooltip = function (_Positionable) { 10935 _inherits(Tooltip, _Positionable); 10936 10937 function Tooltip() { 10938 _classCallCheck(this, Tooltip); 10939 10940 return _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).apply(this, arguments)); 10941 } 10942 10943 _createClass(Tooltip, [{ 10944 key: '_setup', 10945 10946 /** 10947 * Creates a new instance of a Tooltip. 10948 * @class 10949 * @name Tooltip 10950 * @fires Tooltip#init 10951 * @param {jQuery} element - jQuery object to attach a tooltip to. 10952 * @param {Object} options - object to extend the default configuration. 10953 */ 10954 value: function _setup(element, options) { 10955 this.$element = element; 10956 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Tooltip.defaults, this.$element.data(), options); 10957 this.className = 'Tooltip'; // ie9 back compat 10958 10959 this.isActive = false; 10960 this.isClick = false; 10961 10962 // Triggers init is idempotent, just need to make sure it is initialized 10963 __WEBPACK_IMPORTED_MODULE_3__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 10964 10965 this._init(); 10966 } 10967 10968 /** 10969 * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor. 10970 * @private 10971 */ 10972 10973 }, { 10974 key: '_init', 10975 value: function _init() { 10976 __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */]._init(); 10977 var elemId = this.$element.attr('aria-describedby') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["a" /* GetYoDigits */])(6, 'tooltip'); 10978 10979 this.options.tipText = this.options.tipText || this.$element.attr('title'); 10980 this.template = this.options.template ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.template) : this._buildTemplate(elemId); 10981 10982 if (this.options.allowHtml) { 10983 this.template.appendTo(document.body).html(this.options.tipText).hide(); 10984 } else { 10985 this.template.appendTo(document.body).text(this.options.tipText).hide(); 10986 } 10987 10988 this.$element.attr({ 10989 'title': '', 10990 'aria-describedby': elemId, 10991 'data-yeti-box': elemId, 10992 'data-toggle': elemId, 10993 'data-resize': elemId 10994 }).addClass(this.options.triggerClass); 10995 10996 _get(Tooltip.prototype.__proto__ || Object.getPrototypeOf(Tooltip.prototype), '_init', this).call(this); 10997 this._events(); 10998 } 10999 }, { 11000 key: '_getDefaultPosition', 11001 value: function _getDefaultPosition() { 11002 // handle legacy classnames 11003 var position = this.$element[0].className.match(/\b(top|left|right|bottom)\b/g); 11004 return position ? position[0] : 'top'; 11005 } 11006 }, { 11007 key: '_getDefaultAlignment', 11008 value: function _getDefaultAlignment() { 11009 return 'center'; 11010 } 11011 }, { 11012 key: '_getHOffset', 11013 value: function _getHOffset() { 11014 if (this.position === 'left' || this.position === 'right') { 11015 return this.options.hOffset + this.options.tooltipWidth; 11016 } else { 11017 return this.options.hOffset; 11018 } 11019 } 11020 }, { 11021 key: '_getVOffset', 11022 value: function _getVOffset() { 11023 if (this.position === 'top' || this.position === 'bottom') { 11024 return this.options.vOffset + this.options.tooltipHeight; 11025 } else { 11026 return this.options.vOffset; 11027 } 11028 } 11029 11030 /** 11031 * builds the tooltip element, adds attributes, and returns the template. 11032 * @private 11033 */ 11034 11035 }, { 11036 key: '_buildTemplate', 11037 value: function _buildTemplate(id) { 11038 var templateClasses = (this.options.tooltipClass + ' ' + this.options.positionClass + ' ' + this.options.templateClasses).trim(); 11039 var $template = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<div></div>').addClass(templateClasses).attr({ 11040 'role': 'tooltip', 11041 'aria-hidden': true, 11042 'data-is-active': false, 11043 'data-is-focus': false, 11044 'id': id 11045 }); 11046 return $template; 11047 } 11048 11049 /** 11050 * sets the position class of an element and recursively calls itself until there are no more possible positions to attempt, or the tooltip element is no longer colliding. 11051 * if the tooltip is larger than the screen width, default to full width - any user selected margin 11052 * @private 11053 */ 11054 11055 }, { 11056 key: '_setPosition', 11057 value: function _setPosition() { 11058 _get(Tooltip.prototype.__proto__ || Object.getPrototypeOf(Tooltip.prototype), '_setPosition', this).call(this, this.$element, this.template); 11059 } 11060 11061 /** 11062 * reveals the tooltip, and fires an event to close any other open tooltips on the page 11063 * @fires Tooltip#closeme 11064 * @fires Tooltip#show 11065 * @function 11066 */ 11067 11068 }, { 11069 key: 'show', 11070 value: function show() { 11071 if (this.options.showOn !== 'all' && !__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */].is(this.options.showOn)) { 11072 // console.error('The screen is too small to display this tooltip'); 11073 return false; 11074 } 11075 11076 var _this = this; 11077 this.template.css('visibility', 'hidden').show(); 11078 this._setPosition(); 11079 this.template.removeClass('top bottom left right').addClass(this.position); 11080 this.template.removeClass('align-top align-bottom align-left align-right al
vendor: 1,489 bytes, lines 11080-11130
11080ign-center').addClass('align-' + this.alignment); 11081 11082 /** 11083 * Fires to close all other open tooltips on the page 11084 * @event Closeme#tooltip 11085 */ 11086 this.$element.trigger('closeme.zf.tooltip', this.template.attr('id')); 11087 11088 this.template.attr({ 11089 'data-is-active': true, 11090 'aria-hidden': false 11091 }); 11092 _this.isActive = true; 11093 // console.log(this.template); 11094 this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () { 11095 //maybe do stuff? 11096 }); 11097 /** 11098 * Fires when the tooltip is shown 11099 * @event Tooltip#show 11100 */ 11101 this.$element.trigger('show.zf.tooltip'); 11102 } 11103 11104 /** 11105 * Hides the current tooltip, and resets the positioning class if it was changed due to collision 11106 * @fires Tooltip#hide 11107 * @function 11108 */ 11109 11110 }, { 11111 key: 'hide', 11112 value: function hide() { 11113 // console.log('hiding', this.$element.data('yeti-box')); 11114 var _this = this; 11115 this.template.stop().attr({ 11116 'aria-hidden': true, 11117 'data-is-active': false 11118 }).fadeOut(this.options.fadeOutDuration, function () { 11119 _this.isActive = false; 11120 _this.isClick = false; 11121 }); 11122 /** 11123 * fires when the tooltip is hidden 11124 * @event Tooltip#hide 11125 */ 11126 this.$element.trigger('hide.zf.tooltip'); 11127 } 11128 11129 /** 11130 * adds event listeners for the tooltip and its anchor
11131 * TODO combine some of the listeners like focus and mouseenter, etc. 11132 * @private 11133 */ 11134 11135 }, { 11136 key: '_events', 11137 value: function _events() { 11138 var _this = this; 11139 var $template = this.template; 11140 var isFocus = false; 11141 11142 if (!this.options.disableHover) { 11143 11144 this.$element.on('mouseenter.zf.tooltip', function (e) { 11145 if (!_this.isActive) { 11146 _this.timeout = setTimeout(function () { 11147 _this.show(); 11148 }, _this.options.hoverDelay); 11149 } 11150 }).on('mouseleave.zf.tooltip', function (e) { 11151 clearTimeout(_this.timeout); 11152 if (!isFocus || _this.isClick && !_this.options.clickOpen) { 11153 _this.hide(); 11154 } 11155 }); 11156 } 11157 11158 if (this.options.clickOpen) { 11159 this.$element.on('mousedown.zf.tooltip', function (e) { 11160 e.stopImmediatePropagation(); 11161 if (_this.isClick) { 11162 //_this.hide(); 11163 // _this.isClick = false; 11164 } else { 11165 _this.isClick = true; 11166 if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) { 11167 _this.show(); 11168 } 11169 } 11170 }); 11171 } else { 11172 this.$element.on('mousedown.zf.tooltip', function (e) { 11173 e.stopImmediatePropagation(); 11174 _this.isClick = true; 11175 }); 11176 } 11177 11178 if (!this.options.disableForTouch) { 11179 this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function (e) { 11180 _this.isActive ? _this.hide() : _this.show(); 11181 }); 11182 } 11183 11184 this.$element.on({ 11185 // 'toggle.zf.trigger': this.toggle.bind(this), 11186 // 'close.zf.trigger': this.hide.bind(this) 11187 'close.zf.trigger': this.hide.bind(this) 11188 }); 11189 11190 this.$element.on('focus.zf.tooltip', function (e) { 11191 isFocus = true; 11192 if (_this.isClick) { 11193 // If we're not showing open on clicks, we need to pretend a click-launched focus isn't 11194 // a real focus, otherwise on hover and come back we get bad behavior 11195 if (!_this.options.clickOpen) { 11196 isFocus = false; 11197 } 11198 return false; 11199 } else { 11200 _this.show(); 11201 } 11202 }).on('focusout.zf.tooltip', function (e) { 11203 isFocus = false; 11204 _this.isClick = false; 11205 _this.hide(); 11206 }).on('resizeme.zf.trigger', function () { 11207 if (_this.isActive) { 11208 _this._setPosition(); 11209 } 11210 }); 11211 } 11212 11213 /** 11214 * adds a toggle method, in addition to the static show() & hide() functions 11215 * @function 11216 */ 11217 11218 }, { 11219 key: 'toggle', 11220 value: function toggle() { 11221 if (this.isActive) { 11222 this.hide(); 11223 } else { 11224 this.show(); 11225 } 11226 } 11227 11228 /** 11229 * Destroys an instance of tooltip, removes template element from the view. 11230 * @function 11231 */ 11232 11233 }, { 11234 key: '_destroy', 11235 value: function _destroy() { 11236 this.$element.attr('title', this.template.text()).off('.zf.trigger .zf.tooltip').removeClass('has-tip top right left').removeAttr('aria-describedby aria-haspopup data-disable-hover data-resize data-toggle data-tooltip data-yeti-box'); 11237 11238 this.template.remove(); 11239 } 11240 }]); 11241 11242 return Tooltip; 11243}(__WEBPACK_IMPORTED_MODULE_4__foundation_positionable__["a" /* Positionable */]); 11244 11245Tooltip.defaults = { 11246 disableForTouch: false, 11247 /** 11248 * Time, in ms, before a tooltip should open on hover. 11249 * @option 11250 * @type {number} 11251 * @default 200 11252 */ 11253 hoverDelay: 200, 11254 /** 11255 * Time, in ms, a tooltip should take to fade into view. 11256 * @option 11257 * @type {number} 11258 * @default 150 11259 */ 11260 fadeInDuration: 150, 11261 /** 11262 * Time, in ms, a tooltip should take to fade out of view. 11263 * @option 11264 * @type {number} 11265 * @default 150 11266 */ 11267 fadeOutDuration: 150, 11268 /** 11269 * Disables hover events from opening the tooltip if set to true 11270 * @option 11271 * @type {boolean} 11272 * @default false 11273 */ 11274 disableHover: false, 11275 /** 11276 * Optional addtional classes to apply to the tooltip template on init. 11277 * @option 11278 * @type {string} 11279 * @default '' 11280 */ 11281 templateClasses: '', 11282 /** 11283 * Non-optional class added to tooltip templates. Foundation default is 'tooltip'. 11284 * @option 11285 * @type {string} 11286 * @default 'tooltip' 11287 */ 11288 tooltipClass: 'tooltip', 11289 /** 11290 * Class applied to the tooltip anchor element. 11291 * @option 11292 * @type {string} 11293 * @default 'has-tip' 11294 */ 11295 triggerClass: 'has-tip', 11296 /** 11297 * Minimum breakpoint size at which to open the tooltip. 11298 * @option 11299 * @type {string} 11300 * @default 'small' 11301 */ 11302 showOn: 'small', 11303 /** 11304 * Custom template to be used to generate markup for tooltip. 11305 * @option 11306 * @type {string} 11307 * @default '' 11308 */ 11309 template: '', 11310 /** 11311 * Text displayed in the tooltip template on open. 11312 * @option 11313 * @type {string} 11314 * @default '' 11315 */ 11316 tipText: '', 11317 touchCloseText: 'Tap to close.', 11318 /** 11319 * Allows the tooltip to remain open if triggered with a click or touch event. 11320 * @option 11321 * @type {boolean} 11322 * @default true 11323 */ 11324 clickOpen: true, 11325 /** 11326 * DEPRECATED Additional positioning classes, set by the JS 11327 * @option 11328 * @type {string} 11329 * @default '' 11330 */ 11331 positionClass: '', 11332 /** 11333 * Position of tooltip. Can be left, right, bottom, top, or auto. 11334 * @option 11335 * @type {string} 11336 * @default 'auto' 11337 */ 11338 position: 'auto', 11339 /** 11340 * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto. 11341 * @option 11342 * @type {string} 11343 * @default 'auto' 11344 */ 11345 alignment: 'auto', 11346 /** 11347 * Allow overlap of container/window. If false, tooltip will first try to 11348 * position as defined by data-position and data-alignment, but reposition if 11349 * it would cause an overflow. @option 11350 * @type {boolean} 11351 * @default false 11352 */ 11353 allowOverlap: false, 11354 /** 11355 * Allow overlap of only the bottom of the container. This is the most common 11356 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 11357 * screen but not otherwise influence or break out of the container. 11358 * Less common for tooltips. 11359 * @option 11360 * @type {boolean} 11361 * @default false 11362 */ 11363 allowBottomOverlap: false, 11364 /** 11365 * Distance, in pixels, the template should push away from the anch
11365or on the Y axis. 11366 * @option 11367 * @type {number} 11368 * @default 0 11369 */ 11370 vOffset: 0, 11371 /** 11372 * Distance, in pixels, the template should push away from the anchor on the X axis 11373 * @option 11374 * @type {number} 11375 * @default 0 11376 */ 11377 hOffset: 0, 11378 /** 11379 * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip 11380 * @option 11381 * @type {number} 11382 * @default 14 11383 */ 11384 tooltipHeight: 14, 11385 /** 11386 * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip 11387 * @option 11388 * @type {number} 11389 * @default 12 11390 */ 11391 tooltipWidth: 12, 11392 /** 11393 * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips, 11394 * allowing HTML may open yourself up to XSS attacks. 11395 * @option 11396 * @type {boolean} 11397 * @default false 11398 */ 11399 allowHtml: false 11400}; 11401 11402/** 11403 * TODO utilize resize event trigger 11404 */ 11405 11406 11407 11408/***/ }), 11409/* 33 */ 11410/***/ (function(module, __webpack_exports__, __webpack_require__) { 11411 11412"use strict"; 11413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SmoothScroll; }); 11414/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 11415/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 11416/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1); 11417/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2); 11418 11419 11420var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 11421 11422function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11423 11424function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 11425 11426function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 11427 11428 11429 11430 11431 11432/** 11433 * SmoothScroll module. 11434 * @module foundation.smooth-scroll 11435 */ 11436 11437var SmoothScroll = function (_Plugin) { 11438 _inherits(SmoothScroll, _Plugin); 11439 11440 function SmoothScroll() { 11441 _classCallCheck(this, SmoothScroll); 11442 11443 return _possibleConstructorReturn(this, (SmoothScroll.__proto__ || Object.getPrototypeOf(SmoothScroll)).apply(this, arguments)); 11444 } 11445 11446 _createClass(SmoothScroll, [{ 11447 key: '_setup', 11448 11449 /** 11450 * Creates a new instance of SmoothScroll. 11451 * @class 11452 * @name SmoothScroll 11453 * @fires SmoothScroll#init 11454 * @param {Object} element - jQuery object to add the trigger to. 11455 * @param {Object} options - Overrides to the default plugin settings. 11456 */ 11457 value: function _setup(element, options) { 11458 this.$element = element; 11459 this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options); 11460 this.className = 'SmoothScroll'; // ie9 back compat 11461 11462 this._init(); 11463 } 11464 11465 /** 11466 * Initialize the SmoothScroll plugin 11467 * @private 11468 */ 11469 11470 }, { 11471 key: '_init', 11472 value: function _init() { 11473 var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["a" /* GetYoDigits */])(6, 'smooth-scroll'); 11474 var _this = this; 11475 this.$element.attr({ 11476 'id': id 11477 }); 11478 11479 this._events(); 11480 } 11481 11482 /** 11483 * Initializes events for SmoothScroll. 11484 * @private 11485 */ 11486 11487 }, { 11488 key: '_events', 11489 value: function _events() { 11490 var _this = this; 11491 11492 // click handler function. 11493 var handleLinkClick = function (e) { 11494 // exit function if the event source isn't coming from an anchor with href attribute starts with '#' 11495 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is('a[href^="#"]')) { 11496 return false; 11497 } 11498 11499 var arrival = this.getAttribute('href'); 11500 11501 _this._inTransition = true; 11502 11503 SmoothScroll.scrollToLoc(arrival, _this.options, function () { 11504 _this._inTransition = false; 11505 }); 11506 11507 e.preventDefault(); 11508 }; 11509 11510 this.$element.on('click.zf.smoothScroll', handleLinkClick); 11511 this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', handleLinkClick); 11512 } 11513 11514 /** 11515 * Function to scroll to a given location on the page. 11516 * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo' 11517 * @param {Object} options - The options to use. 11518 * @param {Function} callback - The callback function. 11519 * @static 11520 * @function 11521 */ 11522 11523 }], [{ 11524 key: 'scrollToLoc', 11525 value: function scrollToLoc(loc) { 11526 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults; 11527 var callback = arguments[2]; 11528
11529 // Do nothing if target does not exist to prevent errors 11530 if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(loc).length) { 11531 return false; 11532 } 11533 11534 var scrollPos = Math.round(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(loc).offset().top - options.threshold / 2 - options.offset); 11535 11536 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').stop(true).animate({ scrollTop: scrollPos }, options.animationDuration, options.animationEasing, function () { 11537 if (callback && typeof callback == "function") { 11538 callback(); 11539 } 11540 }); 11541 } 11542 }]); 11543 11544 return SmoothScroll; 11545}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["a" /* Plugin */]); 11546 11547/** 11548 * Default settings for plugin. 11549 */ 11550 11551 11552SmoothScroll.defaults = { 11553 /** 11554 * Amount of time, in ms, the animated scrolling should take between locations. 11555 * @option 11556 * @type {number} 11557 * @default 500 11558 */ 11559 animationDuration: 500, 11560 /** 11561 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 11562 * @option 11563 * @type {string} 11564 * @default 'linear' 11565 * @see {@link https://api.jquery.com/animate|Jquery animate} 11566 */ 11567 animationEasing: 'linear', 11568 /** 11569 * Number of pixels to use as a marker for location changes. 11570 * @option 11571 * @type {number} 11572 * @default 50 11573 */ 11574 threshold: 50, 11575 /** 11576 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 11577 * @option 11578 * @type {number} 11579 * @default 0 11580 */ 11581 offset: 0 11582}; 11583 11584 11585 11586/***/ }), 11587/* 34 */ 11588/***/ (function(module, __webpack_exports__, __webpack_require__) { 11589 11590"use strict"; 11591/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Timer; }); 11592/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 11593/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 11594 11595 11596 11597 11598function Timer(elem, options, cb) { 11599 var _this = this, 11600 duration = options.duration, 11601 //options is an object for easily adding features later. 11602 nameSpace = Object.keys(elem.data())[0] || 'timer', 11603 remain = -1, 11604 start, 11605 timer; 11606 11607 this.isPaused = false; 11608 11609 this.restart = function () { 11610 remain = -1; 11611 clearTimeout(timer); 11612 this.start(); 11613 }; 11614 11615 this.start = function () { 11616 this.isPaused = false; 11617 // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 11618 clearTimeout(timer); 11619 remain = remain <= 0 ? duration : remain; 11620 elem.data('paused', false); 11621 start = Date.now(); 11622 timer = setTimeout(function () { 11623 if (options.infinite) { 11624 _this.restart(); //rerun the timer. 11625 } 11626 if (cb && typeof cb === 'function') { 11627 cb(); 11628 } 11629 }, remain); 11630 elem.trigger('timerstart.zf.' + nameSpace); 11631 }; 11632 11633 this.pause = function () { 11634 this.isPaused = true; 11635 //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 11636 clearTimeout(timer); 11637 elem.data('paused', true); 11638 var end = Date.now(); 11639 remain = remain - (end - start); 11640 elem.trigger('timerpaused.zf.' + nameSpace); 11641 }; 11642} 11643 11644 11645 11646/***/ }), 11647/* 35 */ 11648/***/ (function(module, __webpack_exports__, __webpack_require__) { 11649 11650"use strict"; 11651Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 11652/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 11653/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 11654/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__ = __webpack_require__(18); 11655/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_util_mediaQuery__ = __webpack_require__(3); 11656/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_util_triggers__ = __webpack_require__(5); 11657/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_abide__ = __webpack_require__(17); 11658/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_accordion__ = __webpack_require__(10); 11659/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_accordionMenu__ = __webpack_require__(11); 11660/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_drilldown__ = __webpack_require__(12); 11661/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_dropdown__ = __webpack_require__(19); 11662/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_dropdownMenu__ = __webpack_require__(13); 11663/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_equalizer__ = __webpack_require__(20); 11664/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_interchange__ = __webpack_require__(21); 11665/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_magellan__ = __webpack_require__(22); 11666/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_offcanvas__ = __webpack_require__(23); 11667/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_orbit__ = __webpack_require__(24); 11668/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_responsiveMenu__ = __webpack_require__(26); 11669/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_responsiveToggle__ = __webpack_require__(27);
11670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_reveal__ = __webpack_require__(28); 11671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_slider__ = __webpack_require__(29); 11672/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_sticky__ = __webpack_require__(30); 11673/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_tabs__ = __webpack_require__(14); 11674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_toggler__ = __webpack_require__(31); 11675/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_tooltip__ = __webpack_require__(32); 11676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_responsiveAccordionTabs__ = __webpack_require__(25); 11677 11678 11679__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].addToJquery(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 11680 11681__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].MediaQuery = __WEBPACK_IMPORTED_MODULE_2__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_util_mediaQuery__["a" /* MediaQuery */]; 11682 11683__WEBPACK_IMPORTED_MODULE_3__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a, __WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */]); 11684 11685__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_4__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_abide__["a" /* Abide */], 'Abide'); 11686 11687__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_5__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_accordion__["a" /* Accordion */], 'Accordion'); 11688 11689__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_6__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_accordionMenu__["a" /* AccordionMenu */], 'AccordionMenu'); 11690 11691__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_7__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_drilldown__["a" /* Drilldown */], 'Drilldown'); 11692 11693__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_8__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_dropdown__["a" /* Dropdown */], 'Dropdown'); 11694 11695__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_9__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_dropdownMenu__["a" /* DropdownMenu */], 'DropdownMenu'); 11696 11697__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_10__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_equalizer__["a" /* Equalizer */], 'Equalizer'); 11698 11699__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_11__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_interchange__["a" /* Interchange */], 'Interchange'); 11700 11701__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_12__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_magellan__["a" /* Magellan */], 'Magellan'); 11702 11703__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_13__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_offcanvas__["a" /* OffCanvas */], 'OffCanvas'); 11704 11705__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_14__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_orbit__["a" /* Orbit */], 'Orbit'); 11706 11707__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_15__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_responsiveMenu__["a" /* ResponsiveMenu */], 'ResponsiveMenu'); 11708 11709__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_16__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_responsiveToggle__["a" /* ResponsiveToggle */], 'ResponsiveToggle'); 11710 11711__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_17__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_reveal__["a" /* Reveal */], 'Reveal'); 11712 11713__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_18__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_slider__["a" /* Slider */], 'Slider'); 11714 11715__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_19__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_sticky__["a" /* Sticky */], 'Sticky'); 11716 11717__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_20__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_tabs__["a" /* Tabs */], 'Tabs'); 11718 11719__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_21__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_toggler__["a" /* Toggler */], 'Toggler'); 11720 11721__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_22__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_tooltip__["a" /* Tooltip */], 'Tooltip'); 11722 11723__WEBPACK_IMPORTED_MODULE_1__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_core__["a" /* Foundation */].plugin(__WEBPACK_IMPORTED_MODULE_23__home_deployer_sites_node_foundation_customizer_node_foundation_customizer_foundation_sites_js_foundation_responsiveAccordionTabs__["a" /* ResponsiveAccordionTabs */], 'ResponsiveAccordionTabs'); 11724 11725/***/ }) 11726/******/ ]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.