123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("./foundation.util.touch"), require("jquery"));
- else if(typeof define === 'function' && define.amd)
- define(["./foundation.core", "./foundation.util.keyboard", "./foundation.util.mediaQuery", "./foundation.util.motion", "./foundation.util.touch", "jquery"], factory);
- else if(typeof exports === 'object')
- exports["foundation.reveal"] = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("./foundation.util.touch"), require("jquery"));
- else
- root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.reveal"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.touch"], root["jQuery"]);
- })(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __WEBPACK_EXTERNAL_MODULE__foundation_util_touch__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
- return /******/ (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;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // 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 = 14);
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "./foundation.core":
- /*!****************************************************************************************************************************************************************!*\
- !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.core"],"amd":"./foundation.core","commonjs":"./foundation.core","commonjs2":"./foundation.core"} ***!
- \****************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;
- /***/ }),
- /***/ "./foundation.util.keyboard":
- /*!****************************************************************************************************************************************************************************************************!*\
- !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.keyboard"],"amd":"./foundation.util.keyboard","commonjs":"./foundation.util.keyboard","commonjs2":"./foundation.util.keyboard"} ***!
- \****************************************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__;
- /***/ }),
- /***/ "./foundation.util.mediaQuery":
- /*!************************************************************************************************************************************************************************************************************!*\
- !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.mediaQuery"],"amd":"./foundation.util.mediaQuery","commonjs":"./foundation.util.mediaQuery","commonjs2":"./foundation.util.mediaQuery"} ***!
- \************************************************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__;
- /***/ }),
- /***/ "./foundation.util.motion":
- /*!********************************************************************************************************************************************************************************************!*\
- !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.motion"],"amd":"./foundation.util.motion","commonjs":"./foundation.util.motion","commonjs2":"./foundation.util.motion"} ***!
- \********************************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__;
- /***/ }),
- /***/ "./foundation.util.touch":
- /*!****************************************************************************************************************************************************************************************!*\
- !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.touch"],"amd":"./foundation.util.touch","commonjs":"./foundation.util.touch","commonjs2":"./foundation.util.touch"} ***!
- \****************************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_touch__;
- /***/ }),
- /***/ "./js/entries/plugins/foundation.reveal.js":
- /*!*************************************************!*\
- !*** ./js/entries/plugins/foundation.reveal.js ***!
- \*************************************************/
- /*! exports provided: Foundation, Reveal */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ "./foundation.core");
- /* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });
- /* harmony import */ var _foundation_reveal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.reveal */ "./js/foundation.reveal.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return _foundation_reveal__WEBPACK_IMPORTED_MODULE_1__["Reveal"]; });
- _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_reveal__WEBPACK_IMPORTED_MODULE_1__["Reveal"], 'Reveal');
- /***/ }),
- /***/ "./js/foundation.reveal.js":
- /*!*********************************!*\
- !*** ./js/foundation.reveal.js ***!
- \*********************************/
- /*! exports provided: Reveal */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return Reveal; });
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./foundation.core");
- /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./foundation.util.keyboard");
- /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./foundation.util.mediaQuery");
- /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.motion */ "./foundation.util.motion");
- /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
- /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.touch */ "./foundation.util.touch");
- /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__);
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- /**
- * Reveal module.
- * @module foundation.reveal
- * @requires foundation.util.keyboard
- * @requires foundation.util.touch
- * @requires foundation.util.triggers
- * @requires foundation.util.mediaQuery
- * @requires foundation.util.motion if using animations
- */
- var Reveal =
- /*#__PURE__*/
- function (_Plugin) {
- _inherits(Reveal, _Plugin);
- function Reveal() {
- _classCallCheck(this, Reveal);
- return _possibleConstructorReturn(this, _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 = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Reveal.defaults, this.$element.data(), options);
- this.className = 'Reveal'; // ie9 back compat
- this._init(); // Touch and Triggers init are idempotent, just need to make sure they are initialized
- _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
- _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
- _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Reveal', {
- 'ESCAPE': 'close'
- });
- }
- /**
- * Initializes the modal by adding the overlay and close buttons, (if selected).
- * @private
- */
- }, {
- key: "_init",
- value: function _init() {
- var _this2 = this;
- _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init();
- this.id = this.$element.attr('id');
- this.isActive = false;
- this.cached = {
- mq: _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].current
- };
- this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat(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(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo));
- this.$element.addClass('without-overlay');
- }
- this._events();
- if (this.options.deepLink && window.location.hash === "#".concat(this.id)) {
- this.onLoadListener = Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
- return _this2.open();
- });
- }
- }
- /**
- * 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 jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').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 = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width();
- var height = this.$element.outerHeight();
- var outerHeight = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height();
- var left,
- top = null;
- 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 if (this.options.vOffset !== null) {
- top = parseInt(this.options.vOffset, 10);
- }
- if (top !== null) {
- this.$element.css({
- top: top + 'px'
- });
- } // only worry about left if we don't have an overlay or we have a 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 closeZfTrigger(event, $element) {
- if (event.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___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 resizemeZfTrigger() {
- _this._updatePosition();
- }
- });
- if (this.options.closeOnClick && this.options.overlay) {
- this.$overlay.off('.zf.reveal').on('click.zf.dropdown tap.zf.dropdown', function (e) {
- if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) {
- return;
- }
- _this.close();
- });
- }
- if (this.options.deepLink) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on("hashchange.zf.reveal:".concat(this.id), this._handleState.bind(this));
- }
- }
- /**
- * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.
- * @private
- */
- }, {
- key: "_handleState",
- value: function _handleState(e) {
- if (window.location.hash === '#' + this.id && !this.isActive) {
- this.open();
- } else {
- this.close();
- }
- }
- /**
- * Disables the scroll when Reveal is shown to prevent the background from shifting
- * @param {number} scrollTop - Scroll to visually apply, window current scroll by default
- */
- }, {
- key: "_disableScroll",
- value: function _disableScroll(scrollTop) {
- scrollTop = scrollTop || jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop();
- if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", -scrollTop);
- }
- }
- /**
- * Reenables the scroll when Reveal closes
- * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`)
- */
- }, {
- key: "_enableScroll",
- value: function _enableScroll(scrollTop) {
- scrollTop = scrollTop || parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"));
- if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", "");
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(-scrollTop);
- }
- }
- /**
- * 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
- var hash = "#".concat(this.id);
- if (this.options.deepLink && window.location.hash !== hash) {
- if (window.history.pushState) {
- if (this.options.updateHistory) {
- window.history.pushState({}, '', hash);
- } else {
- window.history.replaceState({}, '', hash);
- }
- } else {
- window.location.hash = hash;
- }
- } // Remember anchor that opened it to set focus back later, have general anchors as fallback
- this.$activeAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement).is(this.$anchor) ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement) : this.$anchor;
- 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);
- }
- if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
- this._disableScroll();
- }
- var _this = this; // Motion UI method of reveal
- if (this.options.animationIn) {
- var afterAnimation = function afterAnimation() {
- _this.$element.attr({
- 'aria-hidden': false,
- 'tabindex': -1
- }).focus();
- _this._addGlobalClasses();
- _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(_this.$element);
- };
- if (this.options.overlay) {
- _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateIn(this.$overlay, 'fade-in');
- }
- _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateIn(this.$element, this.options.animationIn, function () {
- if (_this4.$element) {
- // protect against object having been removed
- _this4.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["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();
- _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(this.$element);
- this._addGlobalClasses();
- this._addGlobalListeners();
- /**
- * Fires when the modal has successfully opened.
- * @event Reveal#open
- */
- this.$element.trigger('open.zf.reveal');
- }
- /**
- * Adds classes and listeners on document required by open modals.
- *
- * The following classes are added and updated:
- * - `.is-reveal-open` - Prevents the scroll on document
- * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the
- * scroll was not disabled. This prevent a "shift" of the page content due
- * the scrollbar disappearing when the modal opens.
- *
- * @private
- */
- }, {
- key: "_addGlobalClasses",
- value: function _addGlobalClasses() {
- var updateScrollbarClass = function updateScrollbarClass() {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').toggleClass('zf-has-scroll', !!(jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()));
- };
- this.$element.on('resizeme.zf.trigger.revealScrollbarListener', function () {
- return updateScrollbarClass();
- });
- updateScrollbarClass();
- jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').addClass('is-reveal-open');
- }
- /**
- * Removes classes and listeners on document that were required by open modals.
- * @private
- */
- }, {
- key: "_removeGlobalClasses",
- value: function _removeGlobalClasses() {
- this.$element.off('resizeme.zf.trigger.revealScrollbarListener');
- jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('is-reveal-open');
- jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('zf-has-scroll');
- }
- /**
- * Adds extra event handlers for the body and window if necessary.
- * @private
- */
- }, {
- key: "_addGlobalListeners",
- value: function _addGlobalListeners() {
- var _this = this;
- if (!this.$element) {
- return;
- } // If we're in the middle of cleanup, don't freak out
- this.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].findFocusable(this.$element);
- if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click.zf.dropdown tap.zf.dropdown', function (e) {
- if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) {
- return;
- }
- _this.close();
- });
- }
- if (this.options.closeOnEsc) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('keydown.zf.reveal', function (e) {
- _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Reveal', {
- close: function close() {
- 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) {
- _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateOut(this.$overlay, 'fade-out');
- }
- _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["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) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('keydown.zf.reveal');
- }
- if (!this.options.overlay && this.options.closeOnClick) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('click.zf.dropdown tap.zf.dropdown');
- }
- this.$element.off('keydown.zf.reveal');
- function finishUp() {
- // Get the current top before the modal is closed and restore the scroll after.
- // TODO: use component properties instead of HTML properties
- // See https://github.com/foundation/foundation-sites/pull/10786
- var scrollTop = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"));
- if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
- _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
- }
- _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].releaseFocus(_this.$element);
- _this.$element.attr('aria-hidden', true);
- if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
- _this._enableScroll(scrollTop);
- }
- /**
- * 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 deepLink and we did not switched to an other modal...
- if (_this.options.deepLink && window.location.hash === "#".concat(this.id)) {
- // Remove the history hash
- if (window.history.replaceState) {
- var urlWithoutHash = window.location.pathname + window.location.search;
- if (this.options.updateHistory) {
- window.history.pushState({}, '', urlWithoutHash); // remove the hash
- } else {
- window.history.replaceState('', document.title, urlWithoutHash);
- }
- } else {
- window.location.hash = '';
- }
- }
- this.$activeAnchor.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(jquery__WEBPACK_IMPORTED_MODULE_0___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');
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(".zf.reveal:".concat(this.id));
- if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
- if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
- this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
- }
- }
- }]);
- return Reveal;
- }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["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,
- /**
- * 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,
- /**
- * Link the location hash to the modal.
- * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes.
- * @option
- * @type {boolean}
- * @default false
- */
- deepLink: false,
- /**
- * If `deepLink` is enabled, 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: ''
- };
- /***/ }),
- /***/ "./js/foundation.util.triggers.js":
- /*!****************************************!*\
- !*** ./js/foundation.util.triggers.js ***!
- \****************************************/
- /*! exports provided: Triggers */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; });
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
- /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./foundation.util.motion");
- /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__);
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
- var MutationObserver = function () {
- var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
- for (var i = 0; i < prefixes.length; i++) {
- if ("".concat(prefixes[i], "MutationObserver") in window) {
- return window["".concat(prefixes[i], "MutationObserver")];
- }
- }
- return false;
- }();
- var triggers = function triggers(el, type) {
- el.data(type).split(' ').forEach(function (id) {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]);
- });
- };
- var Triggers = {
- Listeners: {
- Basic: {},
- Global: {}
- },
- Initializers: {}
- };
- Triggers.Listeners.Basic = {
- openListener: function openListener() {
- triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open');
- },
- closeListener: function closeListener() {
- var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close');
- if (id) {
- triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close');
- } else {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger');
- }
- },
- toggleListener: function toggleListener() {
- var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
- if (id) {
- triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle');
- } else {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger');
- }
- },
- closeableListener: function closeableListener(e) {
- var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable'); // Only close the first closable element. See https://git.io/zf-7833
- e.stopPropagation();
- if (animation !== '') {
- _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf');
- });
- } else {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf');
- }
- },
- toggleFocusListener: function toggleFocusListener() {
- var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus');
- jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___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 resizeListener($nodes) {
- if (!MutationObserver) {
- //fallback for IE 9
- $nodes.each(function () {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger');
- });
- } //trigger all listening elements and signal a resize event
- $nodes.attr('data-events', "resize");
- },
- scrollListener: function scrollListener($nodes) {
- if (!MutationObserver) {
- //fallback for IE 9
- $nodes.each(function () {
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger');
- });
- } //trigger all listening elements and signal a scroll event
- $nodes.attr('data-events', "scroll");
- },
- closeMeListener: function closeMeListener(e, pluginId) {
- var plugin = e.namespace.split('.')[0];
- var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]"));
- plugins.each(function () {
- var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
- _this.triggerHandler('close.zf.trigger', [_this]);
- });
- } // Global, parses whole document.
- };
- Triggers.Initializers.addClosemeListener = function (pluginName) {
- var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___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 = plugNames.concat(pluginName);
- } else {
- console.error('Plugin names must be strings');
- }
- }
- if (yetiBoxes.length) {
- var listeners = plugNames.map(function (name) {
- return "closeme.zf.".concat(name);
- }).join(' ');
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);
- }
- };
- function debounceGlobalListener(debounce, trigger, listener) {
- var timer,
- args = Array.prototype.slice.call(arguments, 3);
- jquery__WEBPACK_IMPORTED_MODULE_0___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 = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]');
- if ($nodes.length) {
- debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);
- }
- };
- Triggers.Initializers.addScrollListener = function (debounce) {
- var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___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 listeningElementsMutation(mutationRecordsList) {
- var $target = jquery__WEBPACK_IMPORTED_MODULE_0___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 = jquery__WEBPACK_IMPORTED_MODULE_0___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 = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
- Triggers.Initializers.addMutationEventsListener($document);
- Triggers.Initializers.addResizeListener();
- Triggers.Initializers.addScrollListener();
- Triggers.Initializers.addClosemeListener();
- };
- Triggers.init = function ($, Foundation) {
- Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])($(window), function () {
- if ($.triggersInitialized !== true) {
- 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;
- }
- };
- /***/ }),
- /***/ 14:
- /*!*******************************************************!*\
- !*** multi ./js/entries/plugins/foundation.reveal.js ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.reveal.js */"./js/entries/plugins/foundation.reveal.js");
- /***/ }),
- /***/ "jquery":
- /*!********************************************************************************************!*\
- !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***!
- \********************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
- /***/ })
- /******/ });
- });
- //# sourceMappingURL=foundation.reveal.js.map
|