/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 93); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, exports) { module.exports = jQuery; /***/ }), /***/ 1: /***/ (function(module, exports) { module.exports = {Foundation: window.Foundation}; /***/ }), /***/ 2: /***/ (function(module, exports) { module.exports = {Plugin: window.Foundation.Plugin}; /***/ }), /***/ 27: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_reveal__ = __webpack_require__(57); __WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_reveal__["a" /* Reveal */], 'Reveal'); /***/ }), /***/ 4: /***/ (function(module, exports) { module.exports = {Motion: window.Foundation.Motion, Move: window.Foundation.Move}; /***/ }), /***/ 5: /***/ (function(module, exports) { module.exports = {Keyboard: window.Foundation.Keyboard}; /***/ }), /***/ 57: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Reveal; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_triggers__ = __webpack_require__(7); var _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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _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; } function _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; } /** * Reveal module. * @module foundation.reveal * @requires foundation.util.keyboard * @requires foundation.util.triggers * @requires foundation.util.mediaQuery * @requires foundation.util.motion if using animations */ var Reveal = function (_Plugin) { _inherits(Reveal, _Plugin); function Reveal() { _classCallCheck(this, Reveal); return _possibleConstructorReturn(this, (Reveal.__proto__ || Object.getPrototypeOf(Reveal)).apply(this, arguments)); } _createClass(Reveal, [{ key: '_setup', /** * Creates a new instance of Reveal. * @class * @name Reveal * @param {jQuery} element - jQuery object to use for the modal. * @param {Object} options - optional parameters. */ value: function _setup(element, options) { this.$element = element; this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Reveal.defaults, this.$element.data(), options); this.className = 'Reveal'; // ie9 back compat this._init(); // Triggers init is idempotent, just need to make sure it is initialized __WEBPACK_IMPORTED_MODULE_5__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Reveal', { 'ESCAPE': 'close' }); } /** * Initializes the modal by adding the overlay and close buttons, (if selected). * @private */ }, { key: '_init', value: function _init() { __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["MediaQuery"]._init(); this.id = this.$element.attr('id'); this.isActive = false; this.cached = { mq: __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["MediaQuery"].current }; this.isMobile = mobileSniff(); 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 + '"]'); this.$anchor.attr({ 'aria-controls': this.id, 'aria-haspopup': true, 'tabindex': 0 }); if (this.options.fullScreen || this.$element.hasClass('full')) { this.options.fullScreen = true; this.options.overlay = false; } if (this.options.overlay && !this.$overlay) { this.$overlay = this._makeOverlay(this.id); } this.$element.attr({ 'role': 'dialog', 'aria-hidden': true, 'data-yeti-box': this.id, 'data-resize': this.id }); if (this.$overlay) { this.$element.detach().appendTo(this.$overlay); } else { this.$element.detach().appendTo(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.appendTo)); this.$element.addClass('without-overlay'); } this._events(); if (this.options.deepLink && window.location.hash === '#' + this.id) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).one('load.zf.reveal', this.open.bind(this)); } } /** * Creates an overlay div to display behind the modal. * @private */ }, { key: '_makeOverlay', value: function _makeOverlay() { var additionalOverlayClasses = ''; if (this.options.additionalOverlayClasses) { additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses; } return __WEBPACK_IMPORTED_MODULE_0_jquery___default()('
').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo); } /** * Updates position of modal * TODO: Figure out if we actually need to cache these values or if it doesn't matter * @private */ }, { key: '_updatePosition', value: function _updatePosition() { var width = this.$element.outerWidth(); var outerWidth = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).width(); var height = this.$element.outerHeight(); var outerHeight = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).height(); var left, top; if (this.options.hOffset === 'auto') { left = parseInt((outerWidth - width) / 2, 10); } else { left = parseInt(this.options.hOffset, 10); } if (this.options.vOffset === 'auto') { if (height > outerHeight) { top = parseInt(Math.min(100, outerHeight / 10), 10); } else { top = parseInt((outerHeight - height) / 4, 10); } } else { top = parseInt(this.options.vOffset, 10); } this.$element.css({ top: top + 'px' }); // only worry about left if we don't have an overlay or we havea horizontal offset, // otherwise we're perfectly in the middle if (!this.$overlay || this.options.hOffset !== 'auto') { this.$element.css({ left: left + 'px' }); this.$element.css({ margin: '0px' }); } } /** * Adds event handlers for the modal. * @private */ }, { key: '_events', value: function _events() { var _this3 = this; var _this = this; this.$element.on({ 'open.zf.trigger': this.open.bind(this), 'close.zf.trigger': function (event, $element) { if (event.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default()(event.target).parents('[data-closable]')[0] === $element) { // only close reveal when it's explicitly called return _this3.close.apply(_this3); } }, 'toggle.zf.trigger': this.toggle.bind(this), 'resizeme.zf.trigger': function () { _this._updatePosition(); } }); if (this.options.closeOnClick && this.options.overlay) { this.$overlay.off('.zf.reveal').on('click.zf.reveal', function (e) { 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)) { return; } _this.close(); }); } if (this.options.deepLink) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate.zf.reveal:' + this.id, this._handleState.bind(this)); } } /** * Handles modal methods on back/forward button clicks or any other event that triggers popstate. * @private */ }, { key: '_handleState', value: function _handleState(e) { if (window.location.hash === '#' + this.id && !this.isActive) { this.open(); } else { this.close(); } } /** * Opens the modal controlled by `this.$anchor`, and closes all others by default. * @function * @fires Reveal#closeme * @fires Reveal#open */ }, { key: 'open', value: function open() { var _this4 = this; // either update or replace browser history if (this.options.deepLink) { var hash = '#' + this.id; if (window.history.pushState) { if (this.options.updateHistory) { window.history.pushState({}, '', hash); } else { window.history.replaceState({}, '', hash); } } else { window.location.hash = hash; } } this.isActive = true; // Make elements invisible, but remove display: none so we can get size and positioning this.$element.css({ 'visibility': 'hidden' }).show().scrollTop(0); if (this.options.overlay) { this.$overlay.css({ 'visibility': 'hidden' }).show(); } this._updatePosition(); this.$element.hide().css({ 'visibility': '' }); if (this.$overlay) { this.$overlay.css({ 'visibility': '' }).hide(); if (this.$element.hasClass('fast')) { this.$overlay.addClass('fast'); } else if (this.$element.hasClass('slow')) { this.$overlay.addClass('slow'); } } if (!this.options.multipleOpened) { /** * Fires immediately before the modal opens. * Closes any other modals that are currently open * @event Reveal#closeme */ this.$element.trigger('closeme.zf.reveal', this.id); } var _this = this; function addRevealOpenClasses() { if (_this.isMobile) { if (!_this.originalScrollPos) { _this.originalScrollPos = window.pageYOffset; } __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').addClass('is-reveal-open'); } else { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').addClass('is-reveal-open'); } } // Motion UI method of reveal if (this.options.animationIn) { var afterAnimation = function () { _this.$element.attr({ 'aria-hidden': false, 'tabindex': -1 }).focus(); addRevealOpenClasses(); __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].trapFocus(_this.$element); }; if (this.options.overlay) { __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["Motion"].animateIn(this.$overlay, 'fade-in'); } __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["Motion"].animateIn(this.$element, this.options.animationIn, function () { if (_this4.$element) { // protect against object having been removed _this4.focusableElements = __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].findFocusable(_this4.$element); afterAnimation(); } }); } // jQuery method of reveal else { if (this.options.overlay) { this.$overlay.show(0); } this.$element.show(this.options.showDelay); } // handle accessibility this.$element.attr({ 'aria-hidden': false, 'tabindex': -1 }).focus(); __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].trapFocus(this.$element); addRevealOpenClasses(); this._extraHandlers(); /** * Fires when the modal has successfully opened. * @event Reveal#open */ this.$element.trigger('open.zf.reveal'); } /** * Adds extra event handlers for the body and window if necessary. * @private */ }, { key: '_extraHandlers', value: function _extraHandlers() { var _this = this; if (!this.$element) { return; } // If we're in the middle of cleanup, don't freak out this.focusableElements = __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].findFocusable(this.$element); if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').on('click.zf.reveal', function (e) { 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)) { return; } _this.close(); }); } if (this.options.closeOnEsc) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('keydown.zf.reveal', function (e) { __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Reveal', { close: function () { if (_this.options.closeOnEsc) { _this.close(); } } }); }); } } /** * Closes the modal. * @function * @fires Reveal#closed */ }, { key: 'close', value: function close() { if (!this.isActive || !this.$element.is(':visible')) { return false; } var _this = this; // Motion UI method of hiding if (this.options.animationOut) { if (this.options.overlay) { __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["Motion"].animateOut(this.$overlay, 'fade-out'); } __WEBPACK_IMPORTED_MODULE_3__foundation_util_motion__["Motion"].animateOut(this.$element, this.options.animationOut, finishUp); } // jQuery method of hiding else { this.$element.hide(this.options.hideDelay); if (this.options.overlay) { this.$overlay.hide(0, finishUp); } else { finishUp(); } } // Conditionals to remove extra event listeners added on open if (this.options.closeOnEsc) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('keydown.zf.reveal'); } if (!this.options.overlay && this.options.closeOnClick) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').off('click.zf.reveal'); } this.$element.off('keydown.zf.reveal'); function finishUp() { if (_this.isMobile) { if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.reveal:visible').length === 0) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').removeClass('is-reveal-open'); } if (_this.originalScrollPos) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').scrollTop(_this.originalScrollPos); _this.originalScrollPos = null; } } else { if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.reveal:visible').length === 0) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body').removeClass('is-reveal-open'); } } __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].releaseFocus(_this.$element); _this.$element.attr('aria-hidden', true); /** * Fires when the modal is done closing. * @event Reveal#closed */ _this.$element.trigger('closed.zf.reveal'); } /** * Resets the modal content * This prevents a running video to keep going in the background */ if (this.options.resetOnClose) { this.$element.html(this.$element.html()); } this.isActive = false; if (_this.options.deepLink) { if (window.history.replaceState) { window.history.replaceState('', document.title, window.location.href.replace('#' + this.id, '')); } else { window.location.hash = ''; } } this.$anchor.focus(); } /** * Toggles the open/closed state of a modal. * @function */ }, { key: 'toggle', value: function toggle() { if (this.isActive) { this.close(); } else { this.open(); } } }, { key: '_destroy', /** * Destroys an instance of a modal. * @function */ value: function _destroy() { if (this.options.overlay) { this.$element.appendTo(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin() this.$overlay.hide().off().remove(); } this.$element.hide().off(); this.$anchor.off('.zf'); __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('.zf.reveal:' + this.id); } }]); return Reveal; }(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["Plugin"]); Reveal.defaults = { /** * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. * @option * @type {string} * @default '' */ animationIn: '', /** * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. * @option * @type {string} * @default '' */ animationOut: '', /** * Time, in ms, to delay the opening of a modal after a click if no animation used. * @option * @type {number} * @default 0 */ showDelay: 0, /** * Time, in ms, to delay the closing of a modal after a click if no animation used. * @option * @type {number} * @default 0 */ hideDelay: 0, /** * Allows a click on the body/overlay to close the modal. * @option * @type {boolean} * @default true */ closeOnClick: true, /** * Allows the modal to close if the user presses the `ESCAPE` key. * @option * @type {boolean} * @default true */ closeOnEsc: true, /** * If true, allows multiple modals to be displayed at once. * @option * @type {boolean} * @default false */ multipleOpened: false, /** * Distance, in pixels, the modal should push down from the top of the screen. * @option * @type {number|string} * @default auto */ vOffset: 'auto', /** * Distance, in pixels, the modal should push in from the side of the screen. * @option * @type {number|string} * @default auto */ hOffset: 'auto', /** * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well. * @option * @type {boolean} * @default false */ fullScreen: false, /** * Percentage of screen height the modal should push up from the bottom of the view. * @option * @type {number} * @default 10 */ btmOffsetPct: 10, /** * Allows the modal to generate an overlay div, which will cover the view when modal opens. * @option * @type {boolean} * @default true */ overlay: true, /** * 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. * @option * @type {boolean} * @default false */ resetOnClose: false, /** * 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. * @option * @type {boolean} * @default false */ deepLink: false, /** * Update the browser history with the open modal * @option * @default false */ updateHistory: false, /** * Allows the modal to append to custom div. * @option * @type {string} * @default "body" */ appendTo: "body", /** * Allows adding additional class names to the reveal overlay. * @option * @type {string} * @default '' */ additionalOverlayClasses: '' }; function iPhoneSniff() { return (/iP(ad|hone|od).*OS/.test(window.navigator.userAgent) ); } function androidSniff() { return (/Android/.test(window.navigator.userAgent) ); } function mobileSniff() { return iPhoneSniff() || androidSniff(); } /***/ }), /***/ 6: /***/ (function(module, exports) { module.exports = {MediaQuery: window.Foundation.MediaQuery}; /***/ }), /***/ 7: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Triggers; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__); var MutationObserver = function () { var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; for (var i = 0; i < prefixes.length; i++) { if (prefixes[i] + 'MutationObserver' in window) { return window[prefixes[i] + 'MutationObserver']; } } return false; }(); var triggers = function (el, type) { el.data(type).split(' ').forEach(function (id) { __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id)[type === 'close' ? 'trigger' : 'triggerHandler'](type + '.zf.trigger', [el]); }); }; var Triggers = { Listeners: { Basic: {}, Global: {} }, Initializers: {} }; Triggers.Listeners.Basic = { openListener: function () { triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'open'); }, closeListener: function () { var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('close'); if (id) { triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'close'); } else { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('close.zf.trigger'); } }, toggleListener: function () { var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle'); if (id) { triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'toggle'); } else { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('toggle.zf.trigger'); } }, closeableListener: function (e) { e.stopPropagation(); var animation = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('closable'); if (animation !== '') { __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["Motion"].animateOut(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), animation, function () { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('closed.zf'); }); } else { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).fadeOut().trigger('closed.zf'); } }, toggleFocusListener: function () { var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle-focus'); __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id).triggerHandler('toggle.zf.trigger', [__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)]); } }; // Elements with [data-open] will reveal a plugin that supports it when clicked. Triggers.Initializers.addOpenListener = function ($elem) { $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener); $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener); }; // Elements with [data-close] will close a plugin that supports it when clicked. // If used without a value on [data-close], the event will bubble, allowing it to close a parent component. Triggers.Initializers.addCloseListener = function ($elem) { $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener); $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener); }; // Elements with [data-toggle] will toggle a plugin that supports it when clicked. Triggers.Initializers.addToggleListener = function ($elem) { $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener); $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener); }; // Elements with [data-closable] will respond to close.zf.trigger events. Triggers.Initializers.addCloseableListener = function ($elem) { $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener); $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener); }; // Elements with [data-toggle-focus] will respond to coming in and out of focus Triggers.Initializers.addToggleFocusListener = function ($elem) { $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener); $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener); }; // More Global/complex listeners and triggers Triggers.Listeners.Global = { resizeListener: function ($nodes) { if (!MutationObserver) { //fallback for IE 9 $nodes.each(function () { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('resizeme.zf.trigger'); }); } //trigger all listening elements and signal a resize event $nodes.attr('data-events', "resize"); }, scrollListener: function ($nodes) { if (!MutationObserver) { //fallback for IE 9 $nodes.each(function () { __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('scrollme.zf.trigger'); }); } //trigger all listening elements and signal a scroll event $nodes.attr('data-events', "scroll"); }, closeMeListener: function (e, pluginId) { var plugin = e.namespace.split('.')[0]; var plugins = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + plugin + ']').not('[data-yeti-box="' + pluginId + '"]'); plugins.each(function () { var _this = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this); _this.triggerHandler('close.zf.trigger', [_this]); }); } }; // Global, parses whole document. Triggers.Initializers.addClosemeListener = function (pluginName) { var yetiBoxes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-yeti-box]'), plugNames = ['dropdown', 'tooltip', 'reveal']; if (pluginName) { if (typeof pluginName === 'string') { plugNames.push(pluginName); } else if (typeof pluginName === 'object' && typeof pluginName[0] === 'string') { plugNames.concat(pluginName); } else { console.error('Plugin names must be strings'); } } if (yetiBoxes.length) { var listeners = plugNames.map(function (name) { return 'closeme.zf.' + name; }).join(' '); __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener); } }; function debounceGlobalListener(debounce, trigger, listener) { var timer = void 0, args = Array.prototype.slice.call(arguments, 3); __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(trigger).on(trigger, function (e) { if (timer) { clearTimeout(timer); } timer = setTimeout(function () { listener.apply(null, args); }, debounce || 10); //default time to emit scroll event }); } Triggers.Initializers.addResizeListener = function (debounce) { var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-resize]'); if ($nodes.length) { debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes); } }; Triggers.Initializers.addScrollListener = function (debounce) { var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-scroll]'); if ($nodes.length) { debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes); } }; Triggers.Initializers.addMutationEventsListener = function ($elem) { if (!MutationObserver) { return false; } var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); //element callback var listeningElementsMutation = function (mutationRecordsList) { var $target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(mutationRecordsList[0].target); //trigger the event handler for the element depending on type switch (mutationRecordsList[0].type) { case "attributes": if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") { $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]); } if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") { $target.triggerHandler('resizeme.zf.trigger', [$target]); } if (mutationRecordsList[0].attributeName === "style") { $target.closest("[data-mutate]").attr("data-events", "mutate"); $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); } break; case "childList": $target.closest("[data-mutate]").attr("data-events", "mutate"); $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); break; default: return false; //nothing } }; if ($nodes.length) { //for each element that needs to listen for resizing, scrolling, or mutation add a single observer for (var i = 0; i <= $nodes.length - 1; i++) { var elementObserver = new MutationObserver(listeningElementsMutation); elementObserver.observe($nodes[i], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: ["data-events", "style"] }); } } }; Triggers.Initializers.addSimpleListeners = function () { var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document); Triggers.Initializers.addOpenListener($document); Triggers.Initializers.addCloseListener($document); Triggers.Initializers.addToggleListener($document); Triggers.Initializers.addCloseableListener($document); Triggers.Initializers.addToggleFocusListener($document); }; Triggers.Initializers.addGlobalListeners = function () { var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document); Triggers.Initializers.addMutationEventsListener($document); Triggers.Initializers.addResizeListener(); Triggers.Initializers.addScrollListener(); Triggers.Initializers.addClosemeListener(); }; Triggers.init = function ($, Foundation) { if (typeof $.triggersInitialized === 'undefined') { var $document = $(document); if (document.readyState === "complete") { Triggers.Initializers.addSimpleListeners(); Triggers.Initializers.addGlobalListeners(); } else { $(window).on('load', function () { Triggers.Initializers.addSimpleListeners(); Triggers.Initializers.addGlobalListeners(); }); } $.triggersInitialized = true; } if (Foundation) { Foundation.Triggers = Triggers; // Legacy included to be backwards compatible for now. Foundation.IHearYou = Triggers.Initializers.addGlobalListeners; } }; /***/ }), /***/ 93: /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(27); /***/ }) /******/ });