Changed the example html file from Boostrap to Foundation, Optimized a bit of the Python script and started to look for implementation of Https and SSL for future use.master
parent
e09af20472
commit
450b96ea14
@ -1,9 +1,11 @@
|
|||||||
import http.server
|
import http.server
|
||||||
import socketserver
|
import socketserver
|
||||||
|
import ssl # For future implementation with Openssl
|
||||||
|
|
||||||
PORT = 8080 # Define the standard port
|
PORT = 8080 # Define the standard port
|
||||||
Handler = http.server.SimpleHTTPRequestHandler # Simple http request handler, it commits all files and directories within the SelfHost.py folder
|
IP = 'localhost'
|
||||||
|
Request = http.server.SimpleHTTPRequestHandler # Simple http request handler, it commits all files and directories within the SelfHost.py folder
|
||||||
|
|
||||||
with socketserver.TCPServer(("", PORT), Handler) as httpd: # ("ip address", desired port), call the resquests from files
|
with socketserver.TCPServer((IP, PORT), Request) as httpd: # ("ip address", desired port), call the resquests from files
|
||||||
print("Running @ ", PORT) # Simply outputs on terminal the port that the server is operating
|
print("Running @ ",IP,':',PORT) # Simply outputs on terminal the port that the server is operating
|
||||||
httpd.serve_forever() # Method that simply begins listening and responding to incoming requests
|
httpd.serve_forever() # Method that simply begins listening and responding to incoming requests
|
||||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,661 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.keyboard", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.accordion"] = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.accordion"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __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 = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.accordion.js":
|
||||||
|
/*!****************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.accordion.js ***!
|
||||||
|
\****************************************************/
|
||||||
|
/*! exports provided: Foundation, Accordion */
|
||||||
|
/***/ (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_accordion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.accordion */ "./js/foundation.accordion.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _foundation_accordion__WEBPACK_IMPORTED_MODULE_1__["Accordion"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_accordion__WEBPACK_IMPORTED_MODULE_1__["Accordion"], 'Accordion');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.accordion.js":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** ./js/foundation.accordion.js ***!
|
||||||
|
\************************************/
|
||||||
|
/*! exports provided: Accordion */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; });
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accordion module.
|
||||||
|
* @module foundation.accordion
|
||||||
|
* @requires foundation.util.keyboard
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Accordion =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Accordion, _Plugin);
|
||||||
|
|
||||||
|
function Accordion() {
|
||||||
|
_classCallCheck(this, Accordion);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Accordion).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Accordion, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of an accordion.
|
||||||
|
* @class
|
||||||
|
* @name Accordion
|
||||||
|
* @fires Accordion#init
|
||||||
|
* @param {jQuery} element - jQuery object to make into an accordion.
|
||||||
|
* @param {Object} options - a plain object with settings to override the default options.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Accordion.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'Accordion'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Accordion', {
|
||||||
|
'ENTER': 'toggle',
|
||||||
|
'SPACE': 'toggle',
|
||||||
|
'ARROW_DOWN': 'next',
|
||||||
|
'ARROW_UP': 'previous'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the accordion by animating the preset active pane(s).
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
this._isInitializing = true;
|
||||||
|
this.$element.attr('role', 'tablist');
|
||||||
|
this.$tabs = this.$element.children('[data-accordion-item]');
|
||||||
|
this.$tabs.attr({
|
||||||
|
'role': 'presentation'
|
||||||
|
});
|
||||||
|
this.$tabs.each(function (idx, el) {
|
||||||
|
var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el),
|
||||||
|
$content = $el.children('[data-tab-content]'),
|
||||||
|
id = $content[0].id || Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'accordion'),
|
||||||
|
linkId = el.id ? "".concat(el.id, "-label") : "".concat(id, "-label");
|
||||||
|
$el.find('a:first').attr({
|
||||||
|
'aria-controls': id,
|
||||||
|
'role': 'tab',
|
||||||
|
'id': linkId,
|
||||||
|
'aria-expanded': false,
|
||||||
|
'aria-selected': false
|
||||||
|
});
|
||||||
|
$content.attr({
|
||||||
|
'role': 'tabpanel',
|
||||||
|
'aria-labelledby': linkId,
|
||||||
|
'aria-hidden': true,
|
||||||
|
'id': id
|
||||||
|
});
|
||||||
|
});
|
||||||
|
var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
|
||||||
|
|
||||||
|
if ($initActive.length) {
|
||||||
|
// Save up the initial hash to return to it later when going back in history
|
||||||
|
this._initialAnchor = $initActive.prev('a').attr('href');
|
||||||
|
|
||||||
|
this._openSingleTab($initActive);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._checkDeepLink = function () {
|
||||||
|
var anchor = window.location.hash;
|
||||||
|
|
||||||
|
if (!anchor.length) {
|
||||||
|
// If we are still initializing and there is no anchor, then there is nothing to do
|
||||||
|
if (_this2._isInitializing) return; // Otherwise, move to the initial anchor
|
||||||
|
|
||||||
|
if (_this2._initialAnchor) anchor = _this2._initialAnchor;
|
||||||
|
}
|
||||||
|
|
||||||
|
var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor);
|
||||||
|
|
||||||
|
var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"]")); // Whether the anchor element that has been found is part of this element
|
||||||
|
|
||||||
|
|
||||||
|
var isOwnAnchor = !!($anchor.length && $link.length);
|
||||||
|
|
||||||
|
if (isOwnAnchor) {
|
||||||
|
// If there is an anchor for the hash, open it (if not already active)
|
||||||
|
if ($anchor && $link && $link.length) {
|
||||||
|
if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
|
||||||
|
_this2._openSingleTab($anchor);
|
||||||
|
}
|
||||||
|
} // Otherwise, close everything
|
||||||
|
else {
|
||||||
|
_this2._closeAllTabs();
|
||||||
|
} // Roll up a little to show the titles
|
||||||
|
|
||||||
|
|
||||||
|
if (_this2.options.deepLinkSmudge) {
|
||||||
|
Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
|
||||||
|
var offset = _this2.$element.offset();
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
|
||||||
|
scrollTop: offset.top - _this2.options.deepLinkSmudgeOffset
|
||||||
|
}, _this2.options.deepLinkSmudgeDelay);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the plugin has deeplinked at pageload
|
||||||
|
* @event Accordion#deeplink
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
_this2.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);
|
||||||
|
}
|
||||||
|
}; //use browser to open a tab, if it exists in this tabset
|
||||||
|
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
this._checkDeepLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
|
||||||
|
this._isInitializing = false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event handlers for items within the accordion.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$tabs.each(function () {
|
||||||
|
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
|
||||||
|
var $tabContent = $elem.children('[data-tab-content]');
|
||||||
|
|
||||||
|
if ($tabContent.length) {
|
||||||
|
$elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this.toggle($tabContent);
|
||||||
|
}).on('keydown.zf.accordion', function (e) {
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Accordion', {
|
||||||
|
toggle: function toggle() {
|
||||||
|
_this.toggle($tabContent);
|
||||||
|
},
|
||||||
|
next: function next() {
|
||||||
|
var $a = $elem.next().find('a').focus();
|
||||||
|
|
||||||
|
if (!_this.options.multiExpand) {
|
||||||
|
$a.trigger('click.zf.accordion');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
previous: function previous() {
|
||||||
|
var $a = $elem.prev().find('a').focus();
|
||||||
|
|
||||||
|
if (!_this.options.multiExpand) {
|
||||||
|
$a.trigger('click.zf.accordion');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handled: function handled() {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Toggles the selected content pane's open/close state.
|
||||||
|
* @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "toggle",
|
||||||
|
value: function toggle($target) {
|
||||||
|
if ($target.closest('[data-accordion]').is('[disabled]')) {
|
||||||
|
console.info('Cannot toggle an accordion that is disabled.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($target.parent().hasClass('is-active')) {
|
||||||
|
this.up($target);
|
||||||
|
} else {
|
||||||
|
this.down($target);
|
||||||
|
} //either replace or update browser history
|
||||||
|
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
var anchor = $target.prev('a').attr('href');
|
||||||
|
|
||||||
|
if (this.options.updateHistory) {
|
||||||
|
history.pushState({}, '', anchor);
|
||||||
|
} else {
|
||||||
|
history.replaceState({}, '', anchor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens the accordion tab defined by `$target`.
|
||||||
|
* @param {jQuery} $target - Accordion pane to open (`.accordion-content`).
|
||||||
|
* @fires Accordion#down
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "down",
|
||||||
|
value: function down($target) {
|
||||||
|
if ($target.closest('[data-accordion]').is('[disabled]')) {
|
||||||
|
console.info('Cannot call down on an accordion that is disabled.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.multiExpand) this._openTab($target);else this._openSingleTab($target);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes the tab defined by `$target`.
|
||||||
|
* It may be ignored if the Accordion options don't allow it.
|
||||||
|
*
|
||||||
|
* @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
|
||||||
|
* @fires Accordion#up
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "up",
|
||||||
|
value: function up($target) {
|
||||||
|
if (this.$element.is('[disabled]')) {
|
||||||
|
console.info('Cannot call up on an accordion that is disabled.');
|
||||||
|
return;
|
||||||
|
} // Don't close the item if it is already closed
|
||||||
|
|
||||||
|
|
||||||
|
var $targetItem = $target.parent();
|
||||||
|
if (!$targetItem.hasClass('is-active')) return; // Don't close the item if there is no other active item (unless with `allowAllClosed`)
|
||||||
|
|
||||||
|
var $othersItems = $targetItem.siblings();
|
||||||
|
if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return;
|
||||||
|
|
||||||
|
this._closeTab($target);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Make the tab defined by `$target` the only opened tab, closing all others tabs.
|
||||||
|
* @param {jQuery} $target - Accordion tab to open (`.accordion-content`).
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_openSingleTab",
|
||||||
|
value: function _openSingleTab($target) {
|
||||||
|
// Close all the others active tabs.
|
||||||
|
var $activeContents = this.$element.children('.is-active').children('[data-tab-content]');
|
||||||
|
|
||||||
|
if ($activeContents.length) {
|
||||||
|
this._closeTab($activeContents.not($target));
|
||||||
|
} // Then open the target.
|
||||||
|
|
||||||
|
|
||||||
|
this._openTab($target);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens the tab defined by `$target`.
|
||||||
|
* @param {jQuery} $target - Accordion tab to open (`.accordion-content`).
|
||||||
|
* @fires Accordion#down
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_openTab",
|
||||||
|
value: function _openTab($target) {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var $targetItem = $target.parent();
|
||||||
|
var targetContentId = $target.attr('aria-labelledby');
|
||||||
|
$target.attr('aria-hidden', false);
|
||||||
|
$targetItem.addClass('is-active');
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({
|
||||||
|
'aria-expanded': true,
|
||||||
|
'aria-selected': true
|
||||||
|
});
|
||||||
|
$target.finish().slideDown(this.options.slideSpeed, function () {
|
||||||
|
/**
|
||||||
|
* Fires when the tab is done opening.
|
||||||
|
* @event Accordion#down
|
||||||
|
*/
|
||||||
|
_this3.$element.trigger('down.zf.accordion', [$target]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes the tab defined by `$target`.
|
||||||
|
* @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
|
||||||
|
* @fires Accordion#up
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_closeTab",
|
||||||
|
value: function _closeTab($target) {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
|
var $targetItem = $target.parent();
|
||||||
|
var targetContentId = $target.attr('aria-labelledby');
|
||||||
|
$target.attr('aria-hidden', true);
|
||||||
|
$targetItem.removeClass('is-active');
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({
|
||||||
|
'aria-expanded': false,
|
||||||
|
'aria-selected': false
|
||||||
|
});
|
||||||
|
$target.finish().slideUp(this.options.slideSpeed, function () {
|
||||||
|
/**
|
||||||
|
* Fires when the tab is done collapsing up.
|
||||||
|
* @event Accordion#up
|
||||||
|
*/
|
||||||
|
_this4.$element.trigger('up.zf.accordion', [$target]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes all active tabs
|
||||||
|
* @fires Accordion#up
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_closeAllTabs",
|
||||||
|
value: function _closeAllTabs() {
|
||||||
|
var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]');
|
||||||
|
|
||||||
|
if ($activeTabs.length) {
|
||||||
|
this._closeTab($activeTabs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys an instance of an accordion.
|
||||||
|
* @fires Accordion#destroyed
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
|
||||||
|
this.$element.find('a').off('.zf.accordion');
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Accordion;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
||||||
|
|
||||||
|
Accordion.defaults = {
|
||||||
|
/**
|
||||||
|
* Amount of time to animate the opening of an accordion pane.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 250
|
||||||
|
*/
|
||||||
|
slideSpeed: 250,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the accordion to have multiple open panes.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
multiExpand: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the accordion to close all panes.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowAllClosed: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Link the location hash to the open pane.
|
||||||
|
* Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
deepLink: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
deepLinkSmudge: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 300
|
||||||
|
*/
|
||||||
|
deepLinkSmudgeDelay: 300,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 0
|
||||||
|
*/
|
||||||
|
deepLinkSmudgeOffset: 0,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLink` is enabled, update the browser history with the open accordion
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
updateHistory: false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 1:
|
||||||
|
/*!**********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.accordion.js ***!
|
||||||
|
\**********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.accordion.js */"./js/entries/plugins/foundation.accordion.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.accordion.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,616 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.keyboard", "./foundation.util.nest", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.accordionMenu"] = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.accordionMenu"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.nest"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__, __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 = 2);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.nest":
|
||||||
|
/*!************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.nest"],"amd":"./foundation.util.nest","commonjs":"./foundation.util.nest","commonjs2":"./foundation.util.nest"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.accordionMenu.js":
|
||||||
|
/*!********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.accordionMenu.js ***!
|
||||||
|
\********************************************************/
|
||||||
|
/*! exports provided: Foundation, AccordionMenu */
|
||||||
|
/***/ (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_accordionMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.accordionMenu */ "./js/foundation.accordionMenu.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_1__["AccordionMenu"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_1__["AccordionMenu"], 'AccordionMenu');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.accordionMenu.js":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./js/foundation.accordionMenu.js ***!
|
||||||
|
\****************************************/
|
||||||
|
/*! exports provided: AccordionMenu */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; });
|
||||||
|
/* 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_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./foundation.util.keyboard");
|
||||||
|
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./foundation.util.nest");
|
||||||
|
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AccordionMenu module.
|
||||||
|
* @module foundation.accordionMenu
|
||||||
|
* @requires foundation.util.keyboard
|
||||||
|
* @requires foundation.util.nest
|
||||||
|
*/
|
||||||
|
|
||||||
|
var AccordionMenu =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(AccordionMenu, _Plugin);
|
||||||
|
|
||||||
|
function AccordionMenu() {
|
||||||
|
_classCallCheck(this, AccordionMenu);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(AccordionMenu).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(AccordionMenu, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of an accordion menu.
|
||||||
|
* @class
|
||||||
|
* @name AccordionMenu
|
||||||
|
* @fires AccordionMenu#init
|
||||||
|
* @param {jQuery} element - jQuery object to make into an accordion menu.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'AccordionMenu'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', {
|
||||||
|
'ENTER': 'toggle',
|
||||||
|
'SPACE': 'toggle',
|
||||||
|
'ARROW_RIGHT': 'open',
|
||||||
|
'ARROW_UP': 'up',
|
||||||
|
'ARROW_DOWN': 'down',
|
||||||
|
'ARROW_LEFT': 'close',
|
||||||
|
'ESCAPE': 'closeAll'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the accordion menu by hiding all nested menus.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion');
|
||||||
|
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem');
|
||||||
|
|
||||||
|
this.$element.attr({
|
||||||
|
'role': 'tree',
|
||||||
|
'aria-multiselectable': this.options.multiOpen
|
||||||
|
});
|
||||||
|
this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');
|
||||||
|
this.$menuLinks.each(function () {
|
||||||
|
var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'),
|
||||||
|
$elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$sub = $elem.children('[data-submenu]'),
|
||||||
|
subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'),
|
||||||
|
isActive = $sub.hasClass('is-active');
|
||||||
|
|
||||||
|
if (_this.options.parentLink) {
|
||||||
|
var $anchor = $elem.children('a');
|
||||||
|
$anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-accordion-submenu-item"></li>');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_this.options.submenuToggle) {
|
||||||
|
$elem.addClass('has-submenu-toggle');
|
||||||
|
$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>');
|
||||||
|
} else {
|
||||||
|
$elem.attr({
|
||||||
|
'aria-controls': subId,
|
||||||
|
'aria-expanded': isActive,
|
||||||
|
'id': linkId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$sub.attr({
|
||||||
|
'aria-labelledby': linkId,
|
||||||
|
'aria-hidden': !isActive,
|
||||||
|
'role': 'group',
|
||||||
|
'id': subId
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.$element.find('li').attr({
|
||||||
|
'role': 'treeitem'
|
||||||
|
});
|
||||||
|
var initPanes = this.$element.find('.is-active');
|
||||||
|
|
||||||
|
if (initPanes.length) {
|
||||||
|
initPanes.each(function () {
|
||||||
|
_this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event handlers for items within the menu.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$element.find('li').each(function () {
|
||||||
|
var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]');
|
||||||
|
|
||||||
|
if ($submenu.length) {
|
||||||
|
if (_this.options.submenuToggle) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
|
||||||
|
_this.toggle($submenu);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this.toggle($submenu);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).on('keydown.zf.accordionMenu', function (e) {
|
||||||
|
var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$elements = $element.parent('ul').children('li'),
|
||||||
|
$prevElement,
|
||||||
|
$nextElement,
|
||||||
|
$target = $element.children('[data-submenu]');
|
||||||
|
$elements.each(function (i) {
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
|
||||||
|
$prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first();
|
||||||
|
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first();
|
||||||
|
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) {
|
||||||
|
// has open sub menu
|
||||||
|
$nextElement = $element.find('li:first-child').find('a').first();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) {
|
||||||
|
// is first element of sub menu
|
||||||
|
$prevElement = $element.parents('li').first().find('a').first();
|
||||||
|
} else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) {
|
||||||
|
// if previous element has open sub menu
|
||||||
|
$prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) {
|
||||||
|
// is last element of sub menu
|
||||||
|
$nextElement = $element.parents('li').first().next('li').find('a').first();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', {
|
||||||
|
open: function open() {
|
||||||
|
if ($target.is(':hidden')) {
|
||||||
|
_this.down($target);
|
||||||
|
|
||||||
|
$target.find('li').first().find('a').first().focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close: function close() {
|
||||||
|
if ($target.length && !$target.is(':hidden')) {
|
||||||
|
// close active sub of this item
|
||||||
|
_this.up($target);
|
||||||
|
} else if ($element.parent('[data-submenu]').length) {
|
||||||
|
// close currently open sub
|
||||||
|
_this.up($element.parent('[data-submenu]'));
|
||||||
|
|
||||||
|
$element.parents('li').first().find('a').first().focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
up: function up() {
|
||||||
|
$prevElement.focus();
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
down: function down() {
|
||||||
|
$nextElement.focus();
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
toggle: function toggle() {
|
||||||
|
if (_this.options.submenuToggle) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($element.children('[data-submenu]').length) {
|
||||||
|
_this.toggle($element.children('[data-submenu]'));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeAll: function closeAll() {
|
||||||
|
_this.hideAll();
|
||||||
|
},
|
||||||
|
handled: function handled(preventDefault) {
|
||||||
|
if (preventDefault) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}); //.attr('tabindex', 0);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes all panes of the menu.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "hideAll",
|
||||||
|
value: function hideAll() {
|
||||||
|
this.up(this.$element.find('[data-submenu]'));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens all panes of the menu.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "showAll",
|
||||||
|
value: function showAll() {
|
||||||
|
this.down(this.$element.find('[data-submenu]'));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Toggles the open/close state of a submenu.
|
||||||
|
* @function
|
||||||
|
* @param {jQuery} $target - the submenu to toggle
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "toggle",
|
||||||
|
value: function toggle($target) {
|
||||||
|
if (!$target.is(':animated')) {
|
||||||
|
if (!$target.is(':hidden')) {
|
||||||
|
this.up($target);
|
||||||
|
} else {
|
||||||
|
this.down($target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens the sub-menu defined by `$target`.
|
||||||
|
* @param {jQuery} $target - Sub-menu to open.
|
||||||
|
* @fires AccordionMenu#down
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "down",
|
||||||
|
value: function down($target) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
// If having multiple submenus active is disabled, close all the submenus
|
||||||
|
// that are not parents or children of the targeted submenu.
|
||||||
|
if (!this.options.multiOpen) {
|
||||||
|
// The "branch" of the targetted submenu, from the component root to
|
||||||
|
// the active submenus nested in it.
|
||||||
|
var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch.
|
||||||
|
|
||||||
|
var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);
|
||||||
|
this.up($othersActiveSubmenus);
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.addClass('is-active').attr({
|
||||||
|
'aria-hidden': false
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.options.submenuToggle) {
|
||||||
|
$target.prev('.submenu-toggle').attr({
|
||||||
|
'aria-expanded': true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$target.parent('.is-accordion-submenu-parent').attr({
|
||||||
|
'aria-expanded': true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.slideDown(this.options.slideSpeed, function () {
|
||||||
|
/**
|
||||||
|
* Fires when the menu is done opening.
|
||||||
|
* @event AccordionMenu#down
|
||||||
|
*/
|
||||||
|
_this2.$element.trigger('down.zf.accordionMenu', [$target]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.
|
||||||
|
* @param {jQuery} $target - Sub-menu to close.
|
||||||
|
* @fires AccordionMenu#up
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "up",
|
||||||
|
value: function up($target) {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var $submenus = $target.find('[data-submenu]');
|
||||||
|
var $allmenus = $target.add($submenus);
|
||||||
|
$submenus.slideUp(0);
|
||||||
|
$allmenus.removeClass('is-active').attr('aria-hidden', true);
|
||||||
|
|
||||||
|
if (this.options.submenuToggle) {
|
||||||
|
$allmenus.prev('.submenu-toggle').attr('aria-expanded', false);
|
||||||
|
} else {
|
||||||
|
$allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.slideUp(this.options.slideSpeed, function () {
|
||||||
|
/**
|
||||||
|
* Fires when the menu is done collapsing up.
|
||||||
|
* @event AccordionMenu#up
|
||||||
|
*/
|
||||||
|
_this3.$element.trigger('up.zf.accordionMenu', [$target]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys an instance of accordion menu.
|
||||||
|
* @fires AccordionMenu#destroyed
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.find('[data-submenu]').slideDown(0).css('display', '');
|
||||||
|
this.$element.find('a').off('click.zf.accordionMenu');
|
||||||
|
this.$element.find('[data-is-parent-link]').detach();
|
||||||
|
|
||||||
|
if (this.options.submenuToggle) {
|
||||||
|
this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');
|
||||||
|
this.$element.find('.submenu-toggle').remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion');
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return AccordionMenu;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
|
||||||
|
|
||||||
|
AccordionMenu.defaults = {
|
||||||
|
/**
|
||||||
|
* Adds the parent link to the submenu.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
parentLink: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of time to animate the opening of a submenu in ms.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 250
|
||||||
|
*/
|
||||||
|
slideSpeed: 250,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a separate submenu toggle button. This allows the parent item to have a link.
|
||||||
|
* @option
|
||||||
|
* @example true
|
||||||
|
*/
|
||||||
|
submenuToggle: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text used for the submenu toggle if enabled. This is used for screen readers only.
|
||||||
|
* @option
|
||||||
|
* @example true
|
||||||
|
*/
|
||||||
|
submenuToggleText: 'Toggle menu',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the menu to have multiple open panes.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
multiOpen: true
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 2:
|
||||||
|
/*!**************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.accordionMenu.js ***!
|
||||||
|
\**************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.accordionMenu.js */"./js/entries/plugins/foundation.accordionMenu.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.accordionMenu.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,968 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.box"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.box", "./foundation.util.keyboard", "./foundation.util.nest", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.drilldown"] = factory(require("./foundation.core"), require("./foundation.util.box"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.drilldown"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.box"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.nest"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_box__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__, __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 = 3);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.box":
|
||||||
|
/*!********************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.box"],"amd":"./foundation.util.box","commonjs":"./foundation.util.box","commonjs2":"./foundation.util.box"} ***!
|
||||||
|
\********************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_box__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.nest":
|
||||||
|
/*!************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.nest"],"amd":"./foundation.util.nest","commonjs":"./foundation.util.nest","commonjs2":"./foundation.util.nest"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.drilldown.js":
|
||||||
|
/*!****************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.drilldown.js ***!
|
||||||
|
\****************************************************/
|
||||||
|
/*! exports provided: Foundation, Drilldown */
|
||||||
|
/***/ (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_drilldown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.drilldown */ "./js/foundation.drilldown.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return _foundation_drilldown__WEBPACK_IMPORTED_MODULE_1__["Drilldown"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_drilldown__WEBPACK_IMPORTED_MODULE_1__["Drilldown"], 'Drilldown');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.drilldown.js":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** ./js/foundation.drilldown.js ***!
|
||||||
|
\************************************/
|
||||||
|
/*! exports provided: Drilldown */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; });
|
||||||
|
/* 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_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./foundation.util.keyboard");
|
||||||
|
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./foundation.util.nest");
|
||||||
|
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./foundation.util.box");
|
||||||
|
/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_box__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drilldown module.
|
||||||
|
* @module foundation.drilldown
|
||||||
|
* @requires foundation.util.keyboard
|
||||||
|
* @requires foundation.util.nest
|
||||||
|
* @requires foundation.util.box
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Drilldown =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Drilldown, _Plugin);
|
||||||
|
|
||||||
|
function Drilldown() {
|
||||||
|
_classCallCheck(this, Drilldown);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Drilldown).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Drilldown, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of a drilldown menu.
|
||||||
|
* @class
|
||||||
|
* @name Drilldown
|
||||||
|
* @param {jQuery} element - jQuery object to make into an accordion menu.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'Drilldown'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Drilldown', {
|
||||||
|
'ENTER': 'open',
|
||||||
|
'SPACE': 'open',
|
||||||
|
'ARROW_RIGHT': 'next',
|
||||||
|
'ARROW_UP': 'up',
|
||||||
|
'ARROW_DOWN': 'down',
|
||||||
|
'ARROW_LEFT': 'previous',
|
||||||
|
'ESCAPE': 'close',
|
||||||
|
'TAB': 'down',
|
||||||
|
'SHIFT_TAB': 'up'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the drilldown by creating jQuery collections of elements
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'drilldown');
|
||||||
|
|
||||||
|
if (this.options.autoApplyClass) {
|
||||||
|
this.$element.addClass('drilldown');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element.attr({
|
||||||
|
'role': 'tree',
|
||||||
|
'aria-multiselectable': false
|
||||||
|
});
|
||||||
|
this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
|
||||||
|
this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
|
||||||
|
this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a'); // Set the main menu as current by default (unless a submenu is selected)
|
||||||
|
// Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu
|
||||||
|
|
||||||
|
this.$currentMenu = this.$element;
|
||||||
|
this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'drilldown'));
|
||||||
|
|
||||||
|
this._prepareMenu();
|
||||||
|
|
||||||
|
this._registerEvents();
|
||||||
|
|
||||||
|
this._keyboardEvents();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* prepares drilldown menu by setting attributes to links and elements
|
||||||
|
* sets a min height to prevent content jumping
|
||||||
|
* wraps the element if not already wrapped
|
||||||
|
* @private
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_prepareMenu",
|
||||||
|
value: function _prepareMenu() {
|
||||||
|
var _this = this; // if(!this.options.holdOpen){
|
||||||
|
// this._menuLinkEvents();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
this.$submenuAnchors.each(function () {
|
||||||
|
var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
|
||||||
|
var $sub = $link.parent();
|
||||||
|
|
||||||
|
if (_this.options.parentLink) {
|
||||||
|
$link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="none"></li>');
|
||||||
|
}
|
||||||
|
|
||||||
|
$link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);
|
||||||
|
$link.children('[data-submenu]').attr({
|
||||||
|
'aria-hidden': true,
|
||||||
|
'tabindex': 0,
|
||||||
|
'role': 'group'
|
||||||
|
});
|
||||||
|
|
||||||
|
_this._events($link);
|
||||||
|
});
|
||||||
|
this.$submenus.each(function () {
|
||||||
|
var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$back = $menu.find('.js-drilldown-back');
|
||||||
|
|
||||||
|
if (!$back.length) {
|
||||||
|
switch (_this.options.backButtonPosition) {
|
||||||
|
case "bottom":
|
||||||
|
$menu.append(_this.options.backButton);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "top":
|
||||||
|
$menu.prepend(_this.options.backButton);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_this._back($menu);
|
||||||
|
});
|
||||||
|
this.$submenus.addClass('invisible');
|
||||||
|
|
||||||
|
if (!this.options.autoHeight) {
|
||||||
|
this.$submenus.addClass('drilldown-submenu-cover-previous');
|
||||||
|
} // create a wrapper on element if it doesn't exist.
|
||||||
|
|
||||||
|
|
||||||
|
if (!this.$element.parent().hasClass('is-drilldown')) {
|
||||||
|
this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown');
|
||||||
|
if (this.options.animateHeight) this.$wrapper.addClass('animate-height');
|
||||||
|
this.$element.wrap(this.$wrapper);
|
||||||
|
} // set wrapper
|
||||||
|
|
||||||
|
|
||||||
|
this.$wrapper = this.$element.parent();
|
||||||
|
this.$wrapper.css(this._getMaxDims());
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_resize",
|
||||||
|
value: function _resize() {
|
||||||
|
this.$wrapper.css({
|
||||||
|
'max-width': 'none',
|
||||||
|
'min-height': 'none'
|
||||||
|
}); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths
|
||||||
|
|
||||||
|
this.$wrapper.css(this._getMaxDims());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event handlers to elements in the menu.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {jQuery} $elem - the current menu item to add handlers to.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events($elem) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) {
|
||||||
|
e.preventDefault();
|
||||||
|
} // if(e.target !== e.currentTarget.firstElementChild){
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
_this._show($elem.parent('li'));
|
||||||
|
|
||||||
|
if (_this.options.closeOnClick) {
|
||||||
|
var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body');
|
||||||
|
$body.off('.zf.drilldown').on('click.zf.drilldown', function (e) {
|
||||||
|
if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this._hideAll();
|
||||||
|
|
||||||
|
$body.off('.zf.drilldown');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event handlers to the menu element.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_registerEvents",
|
||||||
|
value: function _registerEvents() {
|
||||||
|
if (this.options.scrollTop) {
|
||||||
|
this._bindHandler = this._scrollTop.bind(this);
|
||||||
|
this.$element.on('open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown', this._bindHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element.on('mutateme.zf.trigger', this._resize.bind(this));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Scroll to Top of Element or data-scroll-top-element
|
||||||
|
* @function
|
||||||
|
* @fires Drilldown#scrollme
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_scrollTop",
|
||||||
|
value: function _scrollTop() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var $scrollTopElement = _this.options.scrollTopElement != '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element,
|
||||||
|
scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({
|
||||||
|
scrollTop: scrollPos
|
||||||
|
}, _this.options.animationDuration, _this.options.animationEasing, function () {
|
||||||
|
/**
|
||||||
|
* Fires after the menu has scrolled
|
||||||
|
* @event Drilldown#scrollme
|
||||||
|
*/
|
||||||
|
if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds keydown event listener to `li`'s in the menu.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_keyboardEvents",
|
||||||
|
value: function _keyboardEvents() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) {
|
||||||
|
var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$elements = $element.parent('li').parent('ul').children('li').children('a'),
|
||||||
|
$prevElement,
|
||||||
|
$nextElement;
|
||||||
|
$elements.each(function (i) {
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
|
||||||
|
$prevElement = $elements.eq(Math.max(0, i - 1));
|
||||||
|
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Drilldown', {
|
||||||
|
next: function next() {
|
||||||
|
if ($element.is(_this.$submenuAnchors)) {
|
||||||
|
_this._show($element.parent('li'));
|
||||||
|
|
||||||
|
$element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
|
||||||
|
$element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
previous: function previous() {
|
||||||
|
_this._hide($element.parent('li').parent('ul'));
|
||||||
|
|
||||||
|
$element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
up: function up() {
|
||||||
|
$prevElement.focus(); // Don't tap focus on first element in root ul
|
||||||
|
|
||||||
|
return !$element.is(_this.$element.find('> li:first-child > a'));
|
||||||
|
},
|
||||||
|
down: function down() {
|
||||||
|
$nextElement.focus(); // Don't tap focus on last element in root ul
|
||||||
|
|
||||||
|
return !$element.is(_this.$element.find('> li:last-child > a'));
|
||||||
|
},
|
||||||
|
close: function close() {
|
||||||
|
// Don't close on element in root ul
|
||||||
|
if (!$element.is(_this.$element.find('> li > a'))) {
|
||||||
|
_this._hide($element.parent().parent());
|
||||||
|
|
||||||
|
$element.parent().parent().siblings('a').focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
open: function open() {
|
||||||
|
if (_this.options.parentLink && $element.attr('href')) {
|
||||||
|
// Link with href
|
||||||
|
return false;
|
||||||
|
} else if (!$element.is(_this.$menuItems)) {
|
||||||
|
// not menu item means back button
|
||||||
|
_this._hide($element.parent('li').parent('ul'));
|
||||||
|
|
||||||
|
$element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
} else if ($element.is(_this.$submenuAnchors)) {
|
||||||
|
// Sub menu item
|
||||||
|
_this._show($element.parent('li'));
|
||||||
|
|
||||||
|
$element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
|
||||||
|
$element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handled: function handled(preventDefault) {
|
||||||
|
if (preventDefault) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}); // end keyboardAccess
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes all open elements, and returns to root menu.
|
||||||
|
* @function
|
||||||
|
* @fires Drilldown#close
|
||||||
|
* @fires Drilldown#closed
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_hideAll",
|
||||||
|
value: function _hideAll() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var $elem = this.$element.find('.is-drilldown-submenu.is-active');
|
||||||
|
$elem.addClass('is-closing');
|
||||||
|
|
||||||
|
if (this.options.autoHeight) {
|
||||||
|
var calcHeight = $elem.parent().closest('ul').data('calcHeight');
|
||||||
|
this.$wrapper.css({
|
||||||
|
height: calcHeight
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the menu is closing.
|
||||||
|
* @event Drilldown#close
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('close.zf.drilldown');
|
||||||
|
$elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () {
|
||||||
|
$elem.removeClass('is-active is-closing');
|
||||||
|
/**
|
||||||
|
* Fires when the menu is fully closed.
|
||||||
|
* @event Drilldown#closed
|
||||||
|
*/
|
||||||
|
|
||||||
|
_this2.$element.trigger('closed.zf.drilldown');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event listener for each `back` button, and closes open menus.
|
||||||
|
* @function
|
||||||
|
* @fires Drilldown#back
|
||||||
|
* @param {jQuery} $elem - the current sub-menu to add `back` event.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_back",
|
||||||
|
value: function _back($elem) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$elem.off('click.zf.drilldown');
|
||||||
|
$elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) {
|
||||||
|
// console.log('mouseup on back');
|
||||||
|
_this._hide($elem); // If there is a parent submenu, call show
|
||||||
|
|
||||||
|
|
||||||
|
var parentSubMenu = $elem.parent('li').parent('ul').parent('li');
|
||||||
|
|
||||||
|
if (parentSubMenu.length) {
|
||||||
|
_this._show(parentSubMenu);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event listener to menu items w/o submenus to close open menus on click.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_menuLinkEvents",
|
||||||
|
value: function _menuLinkEvents() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
|
||||||
|
setTimeout(function () {
|
||||||
|
_this._hideAll();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets the CSS classes for submenu to show it.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {jQuery} $elem - the target submenu (`ul` tag)
|
||||||
|
* @param {boolean} trigger - trigger drilldown event
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_setShowSubMenuClasses",
|
||||||
|
value: function _setShowSubMenuClasses($elem, trigger) {
|
||||||
|
$elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
|
||||||
|
$elem.parent('li').attr('aria-expanded', true);
|
||||||
|
|
||||||
|
if (trigger === true) {
|
||||||
|
this.$element.trigger('open.zf.drilldown', [$elem]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets the CSS classes for submenu to hide it.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {jQuery} $elem - the target submenu (`ul` tag)
|
||||||
|
* @param {boolean} trigger - trigger drilldown event
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_setHideSubMenuClasses",
|
||||||
|
value: function _setHideSubMenuClasses($elem, trigger) {
|
||||||
|
$elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true);
|
||||||
|
$elem.parent('li').attr('aria-expanded', false);
|
||||||
|
|
||||||
|
if (trigger === true) {
|
||||||
|
$elem.trigger('hide.zf.drilldown', [$elem]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible.
|
||||||
|
* Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it.
|
||||||
|
* @function
|
||||||
|
* @fires Drilldown#open
|
||||||
|
* @param {jQuery} $elem - the target (sub)menu (`ul` tag)
|
||||||
|
* @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_showMenu",
|
||||||
|
value: function _showMenu($elem, autoFocus) {
|
||||||
|
var _this = this; // Reset drilldown
|
||||||
|
|
||||||
|
|
||||||
|
var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]');
|
||||||
|
$expandedSubmenus.each(function (index) {
|
||||||
|
_this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
||||||
|
}); // Save the menu as the currently displayed one.
|
||||||
|
|
||||||
|
this.$currentMenu = $elem; // If target menu is root, focus first link & exit
|
||||||
|
|
||||||
|
if ($elem.is('[data-drilldown]')) {
|
||||||
|
if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus();
|
||||||
|
if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));
|
||||||
|
return;
|
||||||
|
} // Find all submenus on way to root incl. the element itself
|
||||||
|
|
||||||
|
|
||||||
|
var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root
|
||||||
|
|
||||||
|
$submenus.each(function (index) {
|
||||||
|
// Update height of first child (target menu) if autoHeight option true
|
||||||
|
if (index === 0 && _this.options.autoHeight) {
|
||||||
|
_this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight'));
|
||||||
|
}
|
||||||
|
|
||||||
|
var isLastChild = index == $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link
|
||||||
|
// Last child makes sure the event gets always triggered even if going through several menus
|
||||||
|
|
||||||
|
if (isLastChild === true) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)), function () {
|
||||||
|
if (autoFocus === true) {
|
||||||
|
$elem.find('li[role="treeitem"] > a').first().focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens a submenu.
|
||||||
|
* @function
|
||||||
|
* @fires Drilldown#open
|
||||||
|
* @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_show",
|
||||||
|
value: function _show($elem) {
|
||||||
|
var $submenu = $elem.children('[data-submenu]');
|
||||||
|
$elem.attr('aria-expanded', true);
|
||||||
|
this.$currentMenu = $submenu;
|
||||||
|
$submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
|
||||||
|
|
||||||
|
if (this.options.autoHeight) {
|
||||||
|
this.$wrapper.css({
|
||||||
|
height: $submenu.data('calcHeight')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the submenu has opened.
|
||||||
|
* @event Drilldown#open
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('open.zf.drilldown', [$elem]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Hides a submenu
|
||||||
|
* @function
|
||||||
|
* @fires Drilldown#hide
|
||||||
|
* @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_hide",
|
||||||
|
value: function _hide($elem) {
|
||||||
|
if (this.options.autoHeight) this.$wrapper.css({
|
||||||
|
height: $elem.parent().closest('ul').data('calcHeight')
|
||||||
|
});
|
||||||
|
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$elem.parent('li').attr('aria-expanded', false);
|
||||||
|
$elem.attr('aria-hidden', true);
|
||||||
|
$elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () {
|
||||||
|
$elem.removeClass('is-active is-closing');
|
||||||
|
$elem.blur().addClass('invisible');
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Fires when the submenu has closed.
|
||||||
|
* @event Drilldown#hide
|
||||||
|
*/
|
||||||
|
|
||||||
|
$elem.trigger('hide.zf.drilldown', [$elem]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Iterates through the nested menus to calculate the min-height, and max-width for the menu.
|
||||||
|
* Prevents content jumping.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_getMaxDims",
|
||||||
|
value: function _getMaxDims() {
|
||||||
|
var maxHeight = 0,
|
||||||
|
result = {},
|
||||||
|
_this = this; // Recalculate menu heights and total max height
|
||||||
|
|
||||||
|
|
||||||
|
this.$submenus.add(this.$element).each(function () {
|
||||||
|
var numOfElems = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('li').length;
|
||||||
|
var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].GetDimensions(this).height;
|
||||||
|
maxHeight = height > maxHeight ? height : maxHeight;
|
||||||
|
|
||||||
|
if (_this.options.autoHeight) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (this.options.autoHeight) result['height'] = this.$currentMenu.data('calcHeight');else result['min-height'] = "".concat(maxHeight, "px");
|
||||||
|
result['max-width'] = "".concat(this.$element[0].getBoundingClientRect().width, "px");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys the Drilldown Menu
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler);
|
||||||
|
|
||||||
|
this._hideAll();
|
||||||
|
|
||||||
|
this.$element.off('mutateme.zf.trigger');
|
||||||
|
_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'drilldown');
|
||||||
|
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');
|
||||||
|
this.$submenuAnchors.each(function () {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown');
|
||||||
|
});
|
||||||
|
this.$element.find('[data-is-parent-link]').detach();
|
||||||
|
this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');
|
||||||
|
this.$element.find('a').each(function () {
|
||||||
|
var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
|
||||||
|
$link.removeAttr('tabindex');
|
||||||
|
|
||||||
|
if ($link.data('savedHref')) {
|
||||||
|
$link.attr('href', $link.data('savedHref')).removeData('savedHref');
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Drilldown;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
|
||||||
|
|
||||||
|
Drilldown.defaults = {
|
||||||
|
/**
|
||||||
|
* Drilldowns depend on styles in order to function properly; in the default build of Foundation these are
|
||||||
|
* on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
autoApplyClass: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>'
|
||||||
|
*/
|
||||||
|
backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default top
|
||||||
|
*/
|
||||||
|
backButtonPosition: 'top',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default '<div></div>'
|
||||||
|
*/
|
||||||
|
wrapper: '<div></div>',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the parent link to the submenu.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
parentLink: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the menu to return to root list on body click.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
closeOnClick: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the menu to auto adjust height.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
autoHeight: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animate the auto adjust height.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
animateHeight: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll to the top of the menu after opening a submenu or navigating back using the menu back button
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
scrollTop: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default ''
|
||||||
|
*/
|
||||||
|
scrollTopElement: '',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ScrollTop offset
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 0
|
||||||
|
*/
|
||||||
|
scrollTopOffset: 0,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll animation duration
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 500
|
||||||
|
*/
|
||||||
|
animationDuration: 500,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll animation easing. Can be `'swing'` or `'linear'`.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @see {@link https://api.jquery.com/animate|JQuery animate}
|
||||||
|
* @default 'swing'
|
||||||
|
*/
|
||||||
|
animationEasing: 'swing' // holdOpen: false
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 3:
|
||||||
|
/*!**********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.drilldown.js ***!
|
||||||
|
\**********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.drilldown.js */"./js/entries/plugins/foundation.drilldown.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.drilldown.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,799 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.box"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("./foundation.util.touch"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.box", "./foundation.util.keyboard", "./foundation.util.nest", "./foundation.util.touch", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.dropdownMenu"] = factory(require("./foundation.core"), require("./foundation.util.box"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("./foundation.util.touch"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.dropdownMenu"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.box"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.nest"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.touch"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_box__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__, __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 = 5);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.box":
|
||||||
|
/*!********************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.box"],"amd":"./foundation.util.box","commonjs":"./foundation.util.box","commonjs2":"./foundation.util.box"} ***!
|
||||||
|
\********************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_box__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.nest":
|
||||||
|
/*!************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.nest"],"amd":"./foundation.util.nest","commonjs":"./foundation.util.nest","commonjs2":"./foundation.util.nest"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.dropdownMenu.js":
|
||||||
|
/*!*******************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.dropdownMenu.js ***!
|
||||||
|
\*******************************************************/
|
||||||
|
/*! exports provided: Foundation, DropdownMenu */
|
||||||
|
/***/ (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_dropdownMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_1__["DropdownMenu"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_1__["DropdownMenu"], 'DropdownMenu');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.dropdownMenu.js":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** ./js/foundation.dropdownMenu.js ***!
|
||||||
|
\***************************************/
|
||||||
|
/*! exports provided: DropdownMenu */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; });
|
||||||
|
/* 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_nest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.nest */ "./foundation.util.nest");
|
||||||
|
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_nest__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./foundation.util.box");
|
||||||
|
/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_box__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./foundation.util.touch");
|
||||||
|
/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DropdownMenu module.
|
||||||
|
* @module foundation.dropdownMenu
|
||||||
|
* @requires foundation.util.keyboard
|
||||||
|
* @requires foundation.util.box
|
||||||
|
* @requires foundation.util.nest
|
||||||
|
* @requires foundation.util.touch
|
||||||
|
*/
|
||||||
|
|
||||||
|
var DropdownMenu =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(DropdownMenu, _Plugin);
|
||||||
|
|
||||||
|
function DropdownMenu() {
|
||||||
|
_classCallCheck(this, DropdownMenu);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(DropdownMenu).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(DropdownMenu, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of DropdownMenu.
|
||||||
|
* @class
|
||||||
|
* @name DropdownMenu
|
||||||
|
* @fires DropdownMenu#init
|
||||||
|
* @param {jQuery} element - jQuery object to make into a dropdown menu.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'DropdownMenu'; // ie9 back compat
|
||||||
|
|
||||||
|
_foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied.
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('DropdownMenu', {
|
||||||
|
'ENTER': 'open',
|
||||||
|
'SPACE': 'open',
|
||||||
|
'ARROW_RIGHT': 'next',
|
||||||
|
'ARROW_UP': 'up',
|
||||||
|
'ARROW_DOWN': 'down',
|
||||||
|
'ARROW_LEFT': 'previous',
|
||||||
|
'ESCAPE': 'close'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the plugin, and calls _prepareMenu
|
||||||
|
* @private
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_nest__WEBPACK_IMPORTED_MODULE_3__["Nest"].Feather(this.$element, 'dropdown');
|
||||||
|
var subs = this.$element.find('li.is-dropdown-submenu-parent');
|
||||||
|
this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');
|
||||||
|
this.$menuItems = this.$element.find('li[role="none"]');
|
||||||
|
this.$tabs = this.$element.children('li[role="none"]');
|
||||||
|
this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);
|
||||||
|
|
||||||
|
if (this.options.alignment === 'auto') {
|
||||||
|
if (this.$element.hasClass(this.options.rightClass) || Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) {
|
||||||
|
this.options.alignment = 'right';
|
||||||
|
subs.addClass('opens-left');
|
||||||
|
} else {
|
||||||
|
this.options.alignment = 'left';
|
||||||
|
subs.addClass('opens-right');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.options.alignment === 'right') {
|
||||||
|
subs.addClass('opens-left');
|
||||||
|
} else {
|
||||||
|
subs.addClass('opens-right');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.changed = false;
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_isVertical",
|
||||||
|
value: function _isVertical() {
|
||||||
|
return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column';
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_isRtl",
|
||||||
|
value: function _isRtl() {
|
||||||
|
return this.$element.hasClass('align-right') || Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["rtl"])() && !this.$element.hasClass('align-left');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event listeners to elements within the menu
|
||||||
|
* @private
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this,
|
||||||
|
hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined',
|
||||||
|
parClass = 'is-dropdown-submenu-parent'; // used for onClick and in the keyboard handlers
|
||||||
|
|
||||||
|
|
||||||
|
var handleClickFn = function handleClickFn(e) {
|
||||||
|
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', ".".concat(parClass)),
|
||||||
|
hasSub = $elem.hasClass(parClass),
|
||||||
|
hasClicked = $elem.attr('data-is-click') === 'true',
|
||||||
|
$sub = $elem.children('.is-dropdown-submenu');
|
||||||
|
|
||||||
|
if (hasSub) {
|
||||||
|
if (hasClicked) {
|
||||||
|
if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this._hide($elem);
|
||||||
|
} else {
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this._show($sub);
|
||||||
|
|
||||||
|
$elem.add($elem.parentsUntil(_this.$element, ".".concat(parClass))).attr('data-is-click', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.options.clickOpen || hasTouch) {
|
||||||
|
this.$menuItems.on('click.zf.dropdownMenu touchstart.zf.dropdownMenu', handleClickFn);
|
||||||
|
} // Handle Leaf element Clicks
|
||||||
|
|
||||||
|
|
||||||
|
if (_this.options.closeOnClickInside) {
|
||||||
|
this.$menuItems.on('click.zf.dropdownMenu', function (e) {
|
||||||
|
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
hasSub = $elem.hasClass(parClass);
|
||||||
|
|
||||||
|
if (!hasSub) {
|
||||||
|
_this._hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.options.disableHover) {
|
||||||
|
this.$menuItems.on('mouseenter.zf.dropdownMenu', function (e) {
|
||||||
|
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
hasSub = $elem.hasClass(parClass);
|
||||||
|
|
||||||
|
if (hasSub) {
|
||||||
|
clearTimeout($elem.data('_delay'));
|
||||||
|
$elem.data('_delay', setTimeout(function () {
|
||||||
|
_this._show($elem.children('.is-dropdown-submenu'));
|
||||||
|
}, _this.options.hoverDelay));
|
||||||
|
}
|
||||||
|
}).on('mouseleave.zf.dropdownMenu', Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function (e) {
|
||||||
|
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
hasSub = $elem.hasClass(parClass);
|
||||||
|
|
||||||
|
if (hasSub && _this.options.autoclose) {
|
||||||
|
if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout($elem.data('_delay'));
|
||||||
|
$elem.data('_delay', setTimeout(function () {
|
||||||
|
_this._hide($elem);
|
||||||
|
}, _this.options.closingTime));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$menuItems.on('keydown.zf.dropdownMenu', function (e) {
|
||||||
|
var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', '[role="none"]'),
|
||||||
|
isTab = _this.$tabs.index($element) > -1,
|
||||||
|
$elements = isTab ? _this.$tabs : $element.siblings('li').add($element),
|
||||||
|
$prevElement,
|
||||||
|
$nextElement;
|
||||||
|
$elements.each(function (i) {
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
|
||||||
|
$prevElement = $elements.eq(i - 1);
|
||||||
|
$nextElement = $elements.eq(i + 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var nextSibling = function nextSibling() {
|
||||||
|
$nextElement.children('a:first').focus();
|
||||||
|
e.preventDefault();
|
||||||
|
},
|
||||||
|
prevSibling = function prevSibling() {
|
||||||
|
$prevElement.children('a:first').focus();
|
||||||
|
e.preventDefault();
|
||||||
|
},
|
||||||
|
openSub = function openSub() {
|
||||||
|
var $sub = $element.children('ul.is-dropdown-submenu');
|
||||||
|
|
||||||
|
if ($sub.length) {
|
||||||
|
_this._show($sub);
|
||||||
|
|
||||||
|
$element.find('li > a:first').focus();
|
||||||
|
e.preventDefault();
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeSub = function closeSub() {
|
||||||
|
//if ($element.is(':first-child')) {
|
||||||
|
var close = $element.parent('ul').parent('li');
|
||||||
|
close.children('a:first').focus();
|
||||||
|
|
||||||
|
_this._hide(close);
|
||||||
|
|
||||||
|
e.preventDefault(); //}
|
||||||
|
};
|
||||||
|
|
||||||
|
var functions = {
|
||||||
|
open: openSub,
|
||||||
|
close: function close() {
|
||||||
|
_this._hide(_this.$element);
|
||||||
|
|
||||||
|
_this.$menuItems.eq(0).children('a').focus(); // focus to first element
|
||||||
|
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (isTab) {
|
||||||
|
if (_this._isVertical()) {
|
||||||
|
// vertical menu
|
||||||
|
if (_this._isRtl()) {
|
||||||
|
// right aligned
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
|
||||||
|
down: nextSibling,
|
||||||
|
up: prevSibling,
|
||||||
|
next: closeSub,
|
||||||
|
previous: openSub
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// left aligned
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
|
||||||
|
down: nextSibling,
|
||||||
|
up: prevSibling,
|
||||||
|
next: openSub,
|
||||||
|
previous: closeSub
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// horizontal menu
|
||||||
|
if (_this._isRtl()) {
|
||||||
|
// right aligned
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
|
||||||
|
next: prevSibling,
|
||||||
|
previous: nextSibling,
|
||||||
|
down: openSub,
|
||||||
|
up: closeSub
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// left aligned
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
|
||||||
|
next: nextSibling,
|
||||||
|
previous: prevSibling,
|
||||||
|
down: openSub,
|
||||||
|
up: closeSub
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// not tabs -> one sub
|
||||||
|
if (_this._isRtl()) {
|
||||||
|
// right aligned
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
|
||||||
|
next: closeSub,
|
||||||
|
previous: openSub,
|
||||||
|
down: nextSibling,
|
||||||
|
up: prevSibling
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// left aligned
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
|
||||||
|
next: openSub,
|
||||||
|
previous: closeSub,
|
||||||
|
down: nextSibling,
|
||||||
|
up: prevSibling
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'DropdownMenu', functions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an event handler to the body to close any dropdowns on a click.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_addBodyHandler",
|
||||||
|
value: function _addBodyHandler() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body);
|
||||||
|
|
||||||
|
this._removeBodyHandler();
|
||||||
|
|
||||||
|
$body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', function (e) {
|
||||||
|
var isItself = !!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).closest(_this2.$element).length;
|
||||||
|
if (isItself) return;
|
||||||
|
|
||||||
|
_this2._hide();
|
||||||
|
|
||||||
|
_this2._removeBodyHandler();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Remove the body event handler. See `_addBodyHandler`.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_removeBodyHandler",
|
||||||
|
value: function _removeBodyHandler() {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdownMenu tap.zf.dropdownMenu');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens a dropdown pane, and checks for collisions first.
|
||||||
|
* @param {jQuery} $sub - ul element that is a submenu to show
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @fires DropdownMenu#show
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_show",
|
||||||
|
value: function _show($sub) {
|
||||||
|
var idx = this.$tabs.index(this.$tabs.filter(function (i, el) {
|
||||||
|
return jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).find($sub).length > 0;
|
||||||
|
}));
|
||||||
|
var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');
|
||||||
|
|
||||||
|
this._hide($sibs, idx);
|
||||||
|
|
||||||
|
$sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active');
|
||||||
|
var clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].ImNotTouchingYou($sub, null, true);
|
||||||
|
|
||||||
|
if (!clear) {
|
||||||
|
var oldClass = this.options.alignment === 'left' ? '-right' : '-left',
|
||||||
|
$parentLi = $sub.parent('.is-dropdown-submenu-parent');
|
||||||
|
$parentLi.removeClass("opens".concat(oldClass)).addClass("opens-".concat(this.options.alignment));
|
||||||
|
clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].ImNotTouchingYou($sub, null, true);
|
||||||
|
|
||||||
|
if (!clear) {
|
||||||
|
$parentLi.removeClass("opens-".concat(this.options.alignment)).addClass('opens-inner');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sub.css('visibility', '');
|
||||||
|
|
||||||
|
if (this.options.closeOnClick) {
|
||||||
|
this._addBodyHandler();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the new dropdown pane is visible.
|
||||||
|
* @event DropdownMenu#show
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('show.zf.dropdownMenu', [$sub]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything.
|
||||||
|
* @function
|
||||||
|
* @param {jQuery} $elem - element with a submenu to hide
|
||||||
|
* @param {Number} idx - index of the $tabs collection to hide
|
||||||
|
* @fires DropdownMenu#hide
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_hide",
|
||||||
|
value: function _hide($elem, idx) {
|
||||||
|
var $toClose;
|
||||||
|
|
||||||
|
if ($elem && $elem.length) {
|
||||||
|
$toClose = $elem;
|
||||||
|
} else if (typeof idx !== 'undefined') {
|
||||||
|
$toClose = this.$tabs.not(function (i, el) {
|
||||||
|
return i === idx;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$toClose = this.$element;
|
||||||
|
}
|
||||||
|
|
||||||
|
var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;
|
||||||
|
|
||||||
|
if (somethingToClose) {
|
||||||
|
var $activeItem = $toClose.find('li.is-active');
|
||||||
|
$activeItem.add($toClose).attr({
|
||||||
|
'data-is-click': false
|
||||||
|
}).removeClass('is-active');
|
||||||
|
$toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active');
|
||||||
|
|
||||||
|
if (this.changed || $toClose.find('opens-inner').length) {
|
||||||
|
var oldClass = this.options.alignment === 'left' ? 'right' : 'left';
|
||||||
|
$toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass("opens-inner opens-".concat(this.options.alignment)).addClass("opens-".concat(oldClass));
|
||||||
|
this.changed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout($activeItem.data('_delay'));
|
||||||
|
|
||||||
|
this._removeBodyHandler();
|
||||||
|
/**
|
||||||
|
* Fires when the open menus are closed.
|
||||||
|
* @event DropdownMenu#hide
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('hide.zf.dropdownMenu', [$toClose]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys the plugin.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
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');
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('.zf.dropdownMenu');
|
||||||
|
_foundation_util_nest__WEBPACK_IMPORTED_MODULE_3__["Nest"].Burn(this.$element, 'dropdown');
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return DropdownMenu;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
||||||
|
/**
|
||||||
|
* Default settings for plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
DropdownMenu.defaults = {
|
||||||
|
/**
|
||||||
|
* Disallows hover events from opening submenus
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
disableHover: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow a submenu to automatically close on a mouseleave event, if not clicked open.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
autoclose: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of time to delay opening a submenu on hover event.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 50
|
||||||
|
*/
|
||||||
|
hoverDelay: 50,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
clickOpen: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of time to delay closing a submenu on a mouseleave event.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 500
|
||||||
|
*/
|
||||||
|
closingTime: 500,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'auto'
|
||||||
|
*/
|
||||||
|
alignment: 'auto',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow clicks on the body to close any open submenus.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
closeOnClick: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow clicks on leaf anchor links to close any open submenus.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
closeOnClickInside: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'vertical'
|
||||||
|
*/
|
||||||
|
verticalClass: 'vertical',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'align-right'
|
||||||
|
*/
|
||||||
|
rightClass: 'align-right',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean to force overide the clicking of links to perform default action, on second touch event for mobile.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
forceFollow: true
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 5:
|
||||||
|
/*!*************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.dropdownMenu.js ***!
|
||||||
|
\*************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.dropdownMenu.js */"./js/entries/plugins/foundation.dropdownMenu.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.dropdownMenu.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,614 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.mediaQuery"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.imageLoader", "./foundation.util.mediaQuery", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.equalizer"] = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.mediaQuery"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.equalizer"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.imageLoader"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __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 = 6);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.imageLoader":
|
||||||
|
/*!****************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.imageLoader"],"amd":"./foundation.util.imageLoader","commonjs":"./foundation.util.imageLoader","commonjs2":"./foundation.util.imageLoader"} ***!
|
||||||
|
\****************************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.equalizer.js":
|
||||||
|
/*!****************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.equalizer.js ***!
|
||||||
|
\****************************************************/
|
||||||
|
/*! exports provided: Foundation, Equalizer */
|
||||||
|
/***/ (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_equalizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.equalizer */ "./js/foundation.equalizer.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return _foundation_equalizer__WEBPACK_IMPORTED_MODULE_1__["Equalizer"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_equalizer__WEBPACK_IMPORTED_MODULE_1__["Equalizer"], 'Equalizer');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.equalizer.js":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** ./js/foundation.equalizer.js ***!
|
||||||
|
\************************************/
|
||||||
|
/*! exports provided: Equalizer */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return Equalizer; });
|
||||||
|
/* 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_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./foundation.util.mediaQuery");
|
||||||
|
/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./foundation.util.imageLoader");
|
||||||
|
/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equalizer module.
|
||||||
|
* @module foundation.equalizer
|
||||||
|
* @requires foundation.util.mediaQuery
|
||||||
|
* @requires foundation.util.imageLoader if equalizer contains images
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Equalizer =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Equalizer, _Plugin);
|
||||||
|
|
||||||
|
function Equalizer() {
|
||||||
|
_classCallCheck(this, Equalizer);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Equalizer).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Equalizer, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of Equalizer.
|
||||||
|
* @class
|
||||||
|
* @name Equalizer
|
||||||
|
* @fires Equalizer#init
|
||||||
|
* @param {Object} element - jQuery object to add the trigger to.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Equalizer.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'Equalizer'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the Equalizer plugin and calls functions to get equalizer functioning on load.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
var eqId = this.$element.attr('data-equalizer') || '';
|
||||||
|
var $watched = this.$element.find("[data-equalizer-watch=\"".concat(eqId, "\"]"));
|
||||||
|
|
||||||
|
_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
|
||||||
|
|
||||||
|
this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');
|
||||||
|
this.$element.attr('data-resize', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq'));
|
||||||
|
this.$element.attr('data-mutate', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq'));
|
||||||
|
this.hasNested = this.$element.find('[data-equalizer]').length > 0;
|
||||||
|
this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;
|
||||||
|
this.isOn = false;
|
||||||
|
this._bindHandler = {
|
||||||
|
onResizeMeBound: this._onResizeMe.bind(this),
|
||||||
|
onPostEqualizedBound: this._onPostEqualized.bind(this)
|
||||||
|
};
|
||||||
|
var imgs = this.$element.find('img');
|
||||||
|
var tooSmall;
|
||||||
|
|
||||||
|
if (this.options.equalizeOn) {
|
||||||
|
tooSmall = this._checkMQ();
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));
|
||||||
|
} else {
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof tooSmall !== 'undefined' && tooSmall === false || typeof tooSmall === 'undefined') {
|
||||||
|
if (imgs.length) {
|
||||||
|
Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__["onImagesLoaded"])(imgs, this._reflow.bind(this));
|
||||||
|
} else {
|
||||||
|
this._reflow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Removes event listeners if the breakpoint is too small.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_pauseEvents",
|
||||||
|
value: function _pauseEvents() {
|
||||||
|
this.isOn = false;
|
||||||
|
this.$element.off({
|
||||||
|
'.zf.equalizer': this._bindHandler.onPostEqualizedBound,
|
||||||
|
'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,
|
||||||
|
'mutateme.zf.trigger': this._bindHandler.onResizeMeBound
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_onResizeMe",
|
||||||
|
value: function _onResizeMe(e) {
|
||||||
|
this._reflow();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_onPostEqualized",
|
||||||
|
value: function _onPostEqualized(e) {
|
||||||
|
if (e.target !== this.$element[0]) {
|
||||||
|
this._reflow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for Equalizer.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this._pauseEvents();
|
||||||
|
|
||||||
|
if (this.hasNested) {
|
||||||
|
this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);
|
||||||
|
} else {
|
||||||
|
this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);
|
||||||
|
this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isOn = true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Checks the current breakpoint to the minimum required size.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_checkMQ",
|
||||||
|
value: function _checkMQ() {
|
||||||
|
var tooSmall = !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].is(this.options.equalizeOn);
|
||||||
|
|
||||||
|
if (tooSmall) {
|
||||||
|
if (this.isOn) {
|
||||||
|
this._pauseEvents();
|
||||||
|
|
||||||
|
this.$watched.css('height', 'auto');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!this.isOn) {
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tooSmall;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* A noop version for the plugin
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_killswitch",
|
||||||
|
value: function _killswitch() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calls necessary functions to update Equalizer upon DOM change
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_reflow",
|
||||||
|
value: function _reflow() {
|
||||||
|
if (!this.options.equalizeOnStack) {
|
||||||
|
if (this._isStacked()) {
|
||||||
|
this.$watched.css('height', 'auto');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.equalizeByRow) {
|
||||||
|
this.getHeightsByRow(this.applyHeightByRow.bind(this));
|
||||||
|
} else {
|
||||||
|
this.getHeights(this.applyHeight.bind(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Manually determines if the first 2 elements are *NOT* stacked.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_isStacked",
|
||||||
|
value: function _isStacked() {
|
||||||
|
if (!this.$watched[0] || !this.$watched[1]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds the outer heights of children contained within an Equalizer parent and returns them in an array
|
||||||
|
* @param {Function} cb - A non-optional callback to return the heights array to.
|
||||||
|
* @returns {Array} heights - An array of heights of children within Equalizer container
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "getHeights",
|
||||||
|
value: function getHeights(cb) {
|
||||||
|
var heights = [];
|
||||||
|
|
||||||
|
for (var i = 0, len = this.$watched.length; i < len; i++) {
|
||||||
|
this.$watched[i].style.height = 'auto';
|
||||||
|
heights.push(this.$watched[i].offsetHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
cb(heights);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Finds the outer heights of children contained within an Equalizer parent and returns them in an array
|
||||||
|
* @param {Function} cb - A non-optional callback to return the heights array to.
|
||||||
|
* @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "getHeightsByRow",
|
||||||
|
value: function getHeightsByRow(cb) {
|
||||||
|
var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0,
|
||||||
|
groups = [],
|
||||||
|
group = 0; //group by Row
|
||||||
|
|
||||||
|
groups[group] = [];
|
||||||
|
|
||||||
|
for (var i = 0, len = this.$watched.length; i < len; i++) {
|
||||||
|
this.$watched[i].style.height = 'auto'; //maybe could use this.$watched[i].offsetTop
|
||||||
|
|
||||||
|
var elOffsetTop = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$watched[i]).offset().top;
|
||||||
|
|
||||||
|
if (elOffsetTop != lastElTopOffset) {
|
||||||
|
group++;
|
||||||
|
groups[group] = [];
|
||||||
|
lastElTopOffset = elOffsetTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var j = 0, ln = groups.length; j < ln; j++) {
|
||||||
|
var heights = jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[j]).map(function () {
|
||||||
|
return this[1];
|
||||||
|
}).get();
|
||||||
|
var max = Math.max.apply(null, heights);
|
||||||
|
groups[j].push(max);
|
||||||
|
}
|
||||||
|
|
||||||
|
cb(groups);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Changes the CSS height property of each child in an Equalizer parent to match the tallest
|
||||||
|
* @param {array} heights - An array of heights of children within Equalizer container
|
||||||
|
* @fires Equalizer#preequalized
|
||||||
|
* @fires Equalizer#postequalized
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "applyHeight",
|
||||||
|
value: function applyHeight(heights) {
|
||||||
|
var max = Math.max.apply(null, heights);
|
||||||
|
/**
|
||||||
|
* Fires before the heights are applied
|
||||||
|
* @event Equalizer#preequalized
|
||||||
|
*/
|
||||||
|
|
||||||
|
this.$element.trigger('preequalized.zf.equalizer');
|
||||||
|
this.$watched.css('height', max);
|
||||||
|
/**
|
||||||
|
* Fires when the heights have been applied
|
||||||
|
* @event Equalizer#postequalized
|
||||||
|
*/
|
||||||
|
|
||||||
|
this.$element.trigger('postequalized.zf.equalizer');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Changes the CSS height property of each child in an Equalizer parent to match the tallest by row
|
||||||
|
* @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
|
||||||
|
* @fires Equalizer#preequalized
|
||||||
|
* @fires Equalizer#preequalizedrow
|
||||||
|
* @fires Equalizer#postequalizedrow
|
||||||
|
* @fires Equalizer#postequalized
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "applyHeightByRow",
|
||||||
|
value: function applyHeightByRow(groups) {
|
||||||
|
/**
|
||||||
|
* Fires before the heights are applied
|
||||||
|
*/
|
||||||
|
this.$element.trigger('preequalized.zf.equalizer');
|
||||||
|
|
||||||
|
for (var i = 0, len = groups.length; i < len; i++) {
|
||||||
|
var groupsILength = groups[i].length,
|
||||||
|
max = groups[i][groupsILength - 1];
|
||||||
|
|
||||||
|
if (groupsILength <= 2) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][0][0]).css({
|
||||||
|
'height': 'auto'
|
||||||
|
});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires before the heights per row are applied
|
||||||
|
* @event Equalizer#preequalizedrow
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('preequalizedrow.zf.equalizer');
|
||||||
|
|
||||||
|
for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][j][0]).css({
|
||||||
|
'height': max
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the heights per row have been applied
|
||||||
|
* @event Equalizer#postequalizedrow
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('postequalizedrow.zf.equalizer');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the heights have been applied
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('postequalized.zf.equalizer');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys an instance of Equalizer.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this._pauseEvents();
|
||||||
|
|
||||||
|
this.$watched.css('height', 'auto');
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Equalizer;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
|
||||||
|
/**
|
||||||
|
* Default settings for plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Equalizer.defaults = {
|
||||||
|
/**
|
||||||
|
* Enable height equalization when stacked on smaller screens.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
equalizeOnStack: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable height equalization row by row.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
equalizeByRow: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String representing the minimum breakpoint size the plugin should equalize heights on.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default ''
|
||||||
|
*/
|
||||||
|
equalizeOn: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 6:
|
||||||
|
/*!**********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.equalizer.js ***!
|
||||||
|
\**********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.equalizer.js */"./js/entries/plugins/foundation.equalizer.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.equalizer.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,796 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.mediaQuery", "./foundation.util.motion", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.interchange"] = factory(require("./foundation.core"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.interchange"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __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 = 7);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.interchange.js":
|
||||||
|
/*!******************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.interchange.js ***!
|
||||||
|
\******************************************************/
|
||||||
|
/*! exports provided: Foundation, Interchange */
|
||||||
|
/***/ (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_interchange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.interchange */ "./js/foundation.interchange.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return _foundation_interchange__WEBPACK_IMPORTED_MODULE_1__["Interchange"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_interchange__WEBPACK_IMPORTED_MODULE_1__["Interchange"], 'Interchange');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.interchange.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./js/foundation.interchange.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! exports provided: Interchange */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return Interchange; });
|
||||||
|
/* 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_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./foundation.util.mediaQuery");
|
||||||
|
/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interchange module.
|
||||||
|
* @module foundation.interchange
|
||||||
|
* @requires foundation.util.mediaQuery
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Interchange =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Interchange, _Plugin);
|
||||||
|
|
||||||
|
function Interchange() {
|
||||||
|
_classCallCheck(this, Interchange);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Interchange).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Interchange, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of Interchange.
|
||||||
|
* @class
|
||||||
|
* @name Interchange
|
||||||
|
* @fires Interchange#init
|
||||||
|
* @param {Object} element - jQuery object to add the trigger to.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Interchange.defaults, this.$element.data(), options);
|
||||||
|
this.rules = [];
|
||||||
|
this.currentPath = '';
|
||||||
|
this.className = 'Interchange'; // ie9 back compat
|
||||||
|
// Triggers init is idempotent, just need to make sure it is initialized
|
||||||
|
|
||||||
|
_foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the Interchange plugin and calls functions to get interchange functioning on load.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
|
||||||
|
|
||||||
|
var id = this.$element[0].id || Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'interchange');
|
||||||
|
this.$element.attr({
|
||||||
|
'data-resize': id,
|
||||||
|
'id': id
|
||||||
|
});
|
||||||
|
|
||||||
|
this._parseOptions();
|
||||||
|
|
||||||
|
this._addBreakpoints();
|
||||||
|
|
||||||
|
this._generateRules();
|
||||||
|
|
||||||
|
this._reflow();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for Interchange.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () {
|
||||||
|
return _this._reflow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calls necessary functions to update Interchange upon DOM change
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_reflow",
|
||||||
|
value: function _reflow() {
|
||||||
|
var match; // Iterate through each rule, but only save the last match
|
||||||
|
|
||||||
|
for (var i in this.rules) {
|
||||||
|
if (this.rules.hasOwnProperty(i)) {
|
||||||
|
var rule = this.rules[i];
|
||||||
|
|
||||||
|
if (window.matchMedia(rule.query).matches) {
|
||||||
|
match = rule;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
this.replace(match.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Check options valifity and set defaults for:
|
||||||
|
* - `data-interchange-type`: if set, enforce the type of replacement (auto, src, background or html)
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_parseOptions",
|
||||||
|
value: function _parseOptions() {
|
||||||
|
var types = ['auto', 'src', 'background', 'html'];
|
||||||
|
if (typeof this.options.type === 'undefined') this.options.type = 'auto';else if (types.indexOf(this.options.type) === -1) {
|
||||||
|
console.log("Warning: invalid value \"".concat(this.options.type, "\" for Interchange option \"type\""));
|
||||||
|
this.options.type = 'auto';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_addBreakpoints",
|
||||||
|
value: function _addBreakpoints() {
|
||||||
|
for (var i in _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries) {
|
||||||
|
if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries.hasOwnProperty(i)) {
|
||||||
|
var query = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries[i];
|
||||||
|
Interchange.SPECIAL_QUERIES[query.name] = query.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Checks the Interchange element for the provided media query + content pairings
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {Object} element - jQuery object that is an Interchange instance
|
||||||
|
* @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_generateRules",
|
||||||
|
value: function _generateRules(element) {
|
||||||
|
var rulesList = [];
|
||||||
|
var rules;
|
||||||
|
|
||||||
|
if (this.options.rules) {
|
||||||
|
rules = this.options.rules;
|
||||||
|
} else {
|
||||||
|
rules = this.$element.data('interchange');
|
||||||
|
}
|
||||||
|
|
||||||
|
rules = typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules;
|
||||||
|
|
||||||
|
for (var i in rules) {
|
||||||
|
if (rules.hasOwnProperty(i)) {
|
||||||
|
var rule = rules[i].slice(1, -1).split(', ');
|
||||||
|
var path = rule.slice(0, -1).join('');
|
||||||
|
var query = rule[rule.length - 1];
|
||||||
|
|
||||||
|
if (Interchange.SPECIAL_QUERIES[query]) {
|
||||||
|
query = Interchange.SPECIAL_QUERIES[query];
|
||||||
|
}
|
||||||
|
|
||||||
|
rulesList.push({
|
||||||
|
path: path,
|
||||||
|
query: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rules = rulesList;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update the `src` property of an image, or change the HTML of a container, to the specified path.
|
||||||
|
* @function
|
||||||
|
* @param {String} path - Path to the image or HTML partial.
|
||||||
|
* @fires Interchange#replaced
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "replace",
|
||||||
|
value: function replace(path) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (this.currentPath === path) return;
|
||||||
|
var trigger = 'replaced.zf.interchange';
|
||||||
|
var type = this.options.type;
|
||||||
|
|
||||||
|
if (type === 'auto') {
|
||||||
|
if (this.$element[0].nodeName === 'IMG') type = 'src';else if (path.match(/\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i)) type = 'background';else type = 'html';
|
||||||
|
} // Replacing images
|
||||||
|
|
||||||
|
|
||||||
|
if (type === 'src') {
|
||||||
|
this.$element.attr('src', path).on('load', function () {
|
||||||
|
_this2.currentPath = path;
|
||||||
|
}).trigger(trigger);
|
||||||
|
} // Replacing background images
|
||||||
|
else if (type === 'background') {
|
||||||
|
path = path.replace(/\(/g, '%28').replace(/\)/g, '%29');
|
||||||
|
this.$element.css({
|
||||||
|
'background-image': 'url(' + path + ')'
|
||||||
|
}).trigger(trigger);
|
||||||
|
} // Replacing HTML
|
||||||
|
else if (type === 'html') {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(path, function (response) {
|
||||||
|
_this2.$element.html(response).trigger(trigger);
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(response).foundation();
|
||||||
|
_this2.currentPath = path;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when content in an Interchange element is done being loaded.
|
||||||
|
* @event Interchange#replaced
|
||||||
|
*/
|
||||||
|
// this.$element.trigger('replaced.zf.interchange');
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys an instance of interchange.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.off('resizeme.zf.trigger');
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Interchange;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
|
||||||
|
/**
|
||||||
|
* Default settings for plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Interchange.defaults = {
|
||||||
|
/**
|
||||||
|
* Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.
|
||||||
|
* @option
|
||||||
|
* @type {?array}
|
||||||
|
* @default null
|
||||||
|
*/
|
||||||
|
rules: null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of the responsive ressource to replace. It can take the following options:
|
||||||
|
* - `auto` (default): choose the type according to the element tag or the ressource extension,
|
||||||
|
* - `src`: replace the `[src]` attribute, recommended for images `<img>`.
|
||||||
|
* - `background`: replace the `background-image` CSS property.
|
||||||
|
* - `html`: replace the element content.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'auto'
|
||||||
|
*/
|
||||||
|
type: 'auto'
|
||||||
|
};
|
||||||
|
Interchange.SPECIAL_QUERIES = {
|
||||||
|
'landscape': 'screen and (orientation: landscape)',
|
||||||
|
'portrait': 'screen and (orientation: portrait)',
|
||||||
|
'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)'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7:
|
||||||
|
/*!************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.interchange.js ***!
|
||||||
|
\************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.interchange.js */"./js/entries/plugins/foundation.interchange.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.interchange.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,850 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.smoothScroll"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.smoothScroll", "./foundation.util.motion", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.magellan"] = factory(require("./foundation.core"), require("./foundation.smoothScroll"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.magellan"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.smoothScroll"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_smoothScroll__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __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 = 8);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.smoothScroll":
|
||||||
|
/*!************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.smoothScroll"],"amd":"./foundation.smoothScroll","commonjs":"./foundation.smoothScroll","commonjs2":"./foundation.smoothScroll"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_smoothScroll__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.magellan.js":
|
||||||
|
/*!***************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.magellan.js ***!
|
||||||
|
\***************************************************/
|
||||||
|
/*! exports provided: Foundation, Magellan */
|
||||||
|
/***/ (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_magellan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.magellan */ "./js/foundation.magellan.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return _foundation_magellan__WEBPACK_IMPORTED_MODULE_1__["Magellan"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_magellan__WEBPACK_IMPORTED_MODULE_1__["Magellan"], 'Magellan');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.magellan.js":
|
||||||
|
/*!***********************************!*\
|
||||||
|
!*** ./js/foundation.magellan.js ***!
|
||||||
|
\***********************************/
|
||||||
|
/*! exports provided: Magellan */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return Magellan; });
|
||||||
|
/* 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_smoothScroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.smoothScroll */ "./foundation.smoothScroll");
|
||||||
|
/* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magellan module.
|
||||||
|
* @module foundation.magellan
|
||||||
|
* @requires foundation.smoothScroll
|
||||||
|
* @requires foundation.util.triggers
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Magellan =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Magellan, _Plugin);
|
||||||
|
|
||||||
|
function Magellan() {
|
||||||
|
_classCallCheck(this, Magellan);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Magellan).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Magellan, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of Magellan.
|
||||||
|
* @class
|
||||||
|
* @name Magellan
|
||||||
|
* @fires Magellan#init
|
||||||
|
* @param {Object} element - jQuery object to add the trigger to.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Magellan.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'Magellan'; // ie9 back compat
|
||||||
|
// Triggers init is idempotent, just need to make sure it is initialized
|
||||||
|
|
||||||
|
_foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
this.calcPoints();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the Magellan plugin and calls functions to get equalizer functioning on load.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
var id = this.$element[0].id || Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'magellan');
|
||||||
|
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$targets = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-magellan-target]');
|
||||||
|
this.$links = this.$element.find('a');
|
||||||
|
this.$element.attr({
|
||||||
|
'data-resize': id,
|
||||||
|
'data-scroll': id,
|
||||||
|
'id': id
|
||||||
|
});
|
||||||
|
this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
|
||||||
|
this.scrollPos = parseInt(window.pageYOffset, 10);
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calculates an array of pixel values that are the demarcation lines between locations on the page.
|
||||||
|
* Can be invoked if new elements are added or the size of a location changes.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "calcPoints",
|
||||||
|
value: function calcPoints() {
|
||||||
|
var _this = this,
|
||||||
|
body = document.body,
|
||||||
|
html = document.documentElement;
|
||||||
|
|
||||||
|
this.points = [];
|
||||||
|
this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
|
||||||
|
this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));
|
||||||
|
this.$targets.each(function () {
|
||||||
|
var $tar = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
pt = Math.round($tar.offset().top - _this.options.threshold);
|
||||||
|
$tar.targetPoint = pt;
|
||||||
|
|
||||||
|
_this.points.push(pt);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for Magellan.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', function () {
|
||||||
|
if (_this.options.deepLinking) {
|
||||||
|
if (location.hash) {
|
||||||
|
_this.scrollToLoc(location.hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.calcPoints();
|
||||||
|
|
||||||
|
_this._updateActive();
|
||||||
|
});
|
||||||
|
_this.onLoadListener = Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
|
||||||
|
_this.$element.on({
|
||||||
|
'resizeme.zf.trigger': _this.reflow.bind(_this),
|
||||||
|
'scrollme.zf.trigger': _this._updateActive.bind(_this)
|
||||||
|
}).on('click.zf.magellan', 'a[href^="#"]', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var arrival = this.getAttribute('href');
|
||||||
|
|
||||||
|
_this.scrollToLoc(arrival);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this._deepLinkScroll = function (e) {
|
||||||
|
if (_this.options.deepLinking) {
|
||||||
|
_this.scrollToLoc(window.location.hash);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._deepLinkScroll);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Function to scroll to a given location on the page.
|
||||||
|
* @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "scrollToLoc",
|
||||||
|
value: function scrollToLoc(loc) {
|
||||||
|
this._inTransition = true;
|
||||||
|
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
animationEasing: this.options.animationEasing,
|
||||||
|
animationDuration: this.options.animationDuration,
|
||||||
|
threshold: this.options.threshold,
|
||||||
|
offset: this.options.offset
|
||||||
|
};
|
||||||
|
_foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_2__["SmoothScroll"].scrollToLoc(loc, options, function () {
|
||||||
|
_this._inTransition = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calls necessary functions to update Magellan upon DOM change
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "reflow",
|
||||||
|
value: function reflow() {
|
||||||
|
this.calcPoints();
|
||||||
|
|
||||||
|
this._updateActive();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.
|
||||||
|
* @private
|
||||||
|
* @function
|
||||||
|
* @fires Magellan#update
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_updateActive",
|
||||||
|
value: function _updateActive()
|
||||||
|
/*evt, elem, scrollPos*/
|
||||||
|
{
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (this._inTransition) return;
|
||||||
|
var newScrollPos = parseInt(window.pageYOffset, 10);
|
||||||
|
var isScrollingUp = this.scrollPos > newScrollPos;
|
||||||
|
this.scrollPos = newScrollPos;
|
||||||
|
var activeIdx; // Before the first point: no link
|
||||||
|
|
||||||
|
if (newScrollPos < this.points[0]) {}
|
||||||
|
/* do nothing */
|
||||||
|
// At the bottom of the page: last link
|
||||||
|
else if (newScrollPos + this.winHeight === this.docHeight) {
|
||||||
|
activeIdx = this.points.length - 1;
|
||||||
|
} // Otherwhise, use the last visible link
|
||||||
|
else {
|
||||||
|
var visibleLinks = this.points.filter(function (p, i) {
|
||||||
|
return p - _this2.options.offset - (isScrollingUp ? _this2.options.threshold : 0) <= newScrollPos;
|
||||||
|
});
|
||||||
|
activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;
|
||||||
|
} // Get the new active link
|
||||||
|
|
||||||
|
|
||||||
|
var $oldActive = this.$active;
|
||||||
|
var activeHash = '';
|
||||||
|
|
||||||
|
if (typeof activeIdx !== 'undefined') {
|
||||||
|
this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]');
|
||||||
|
if (this.$active.length) activeHash = this.$active[0].getAttribute('href');
|
||||||
|
} else {
|
||||||
|
this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
|
||||||
|
}
|
||||||
|
|
||||||
|
var isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);
|
||||||
|
var isNewHash = activeHash !== window.location.hash; // Update the active link element
|
||||||
|
|
||||||
|
if (isNewActive) {
|
||||||
|
$oldActive.removeClass(this.options.activeClass);
|
||||||
|
this.$active.addClass(this.options.activeClass);
|
||||||
|
} // Update the hash (it may have changed with the same active link)
|
||||||
|
|
||||||
|
|
||||||
|
if (this.options.deepLinking && isNewHash) {
|
||||||
|
if (window.history.pushState) {
|
||||||
|
// Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384
|
||||||
|
var url = activeHash ? activeHash : window.location.pathname + window.location.search;
|
||||||
|
|
||||||
|
if (this.options.updateHistory) {
|
||||||
|
window.history.pushState({}, '', url);
|
||||||
|
} else {
|
||||||
|
window.history.replaceState({}, '', url);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window.location.hash = activeHash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNewActive) {
|
||||||
|
/**
|
||||||
|
* Fires when magellan is finished updating to the new active element.
|
||||||
|
* @event Magellan#update
|
||||||
|
*/
|
||||||
|
this.$element.trigger('update.zf.magellan', [this.$active]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys an instance of Magellan and resets the url of the window.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.off('.zf.trigger .zf.magellan').find(".".concat(this.options.activeClass)).removeClass(this.options.activeClass);
|
||||||
|
|
||||||
|
if (this.options.deepLinking) {
|
||||||
|
var hash = this.$active[0].getAttribute('href');
|
||||||
|
window.location.hash.replace(hash, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._deepLinkScroll);
|
||||||
|
if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Magellan;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
||||||
|
/**
|
||||||
|
* Default settings for plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Magellan.defaults = {
|
||||||
|
/**
|
||||||
|
* Amount of time, in ms, the animated scrolling should take between locations.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 500
|
||||||
|
*/
|
||||||
|
animationDuration: 500,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'linear'
|
||||||
|
* @see {@link https://api.jquery.com/animate|Jquery animate}
|
||||||
|
*/
|
||||||
|
animationEasing: 'linear',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of pixels to use as a marker for location changes.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 50
|
||||||
|
*/
|
||||||
|
threshold: 50,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the active locations link on the magellan container.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'is-active'
|
||||||
|
*/
|
||||||
|
activeClass: 'is-active',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the script to manipulate the url of the current page, and if supported, alter the history.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
deepLinking: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the browser history with the active link, if deep linking is enabled.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
updateHistory: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 0
|
||||||
|
*/
|
||||||
|
offset: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 8:
|
||||||
|
/*!*********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.magellan.js ***!
|
||||||
|
\*********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.magellan.js */"./js/entries/plugins/foundation.magellan.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.magellan.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,886 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.keyboard"), require("./foundation.util.motion"), require("./foundation.util.timer"), require("./foundation.util.touch"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.imageLoader", "./foundation.util.keyboard", "./foundation.util.motion", "./foundation.util.timer", "./foundation.util.touch", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.orbit"] = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.keyboard"), require("./foundation.util.motion"), require("./foundation.util.timer"), require("./foundation.util.touch"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.orbit"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.imageLoader"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.timer"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.touch"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __WEBPACK_EXTERNAL_MODULE__foundation_util_timer__, __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 = 10);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.imageLoader":
|
||||||
|
/*!****************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.imageLoader"],"amd":"./foundation.util.imageLoader","commonjs":"./foundation.util.imageLoader","commonjs2":"./foundation.util.imageLoader"} ***!
|
||||||
|
\****************************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.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.timer":
|
||||||
|
/*!****************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.timer"],"amd":"./foundation.util.timer","commonjs":"./foundation.util.timer","commonjs2":"./foundation.util.timer"} ***!
|
||||||
|
\****************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_timer__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.orbit.js":
|
||||||
|
/*!************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.orbit.js ***!
|
||||||
|
\************************************************/
|
||||||
|
/*! exports provided: Foundation, Orbit */
|
||||||
|
/***/ (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_orbit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.orbit */ "./js/foundation.orbit.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return _foundation_orbit__WEBPACK_IMPORTED_MODULE_1__["Orbit"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_orbit__WEBPACK_IMPORTED_MODULE_1__["Orbit"], 'Orbit');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.orbit.js":
|
||||||
|
/*!********************************!*\
|
||||||
|
!*** ./js/foundation.orbit.js ***!
|
||||||
|
\********************************/
|
||||||
|
/*! exports provided: Orbit */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; });
|
||||||
|
/* 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_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./foundation.util.keyboard");
|
||||||
|
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_keyboard__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__);
|
||||||
|
/* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.timer */ "./foundation.util.timer");
|
||||||
|
/* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./foundation.util.imageLoader");
|
||||||
|
/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
|
/* 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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Orbit module.
|
||||||
|
* @module foundation.orbit
|
||||||
|
* @requires foundation.util.keyboard
|
||||||
|
* @requires foundation.util.motion
|
||||||
|
* @requires foundation.util.timer
|
||||||
|
* @requires foundation.util.imageLoader
|
||||||
|
* @requires foundation.util.touch
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Orbit =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Orbit, _Plugin);
|
||||||
|
|
||||||
|
function Orbit() {
|
||||||
|
_classCallCheck(this, Orbit);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Orbit).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Orbit, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of an orbit carousel.
|
||||||
|
* @class
|
||||||
|
* @name Orbit
|
||||||
|
* @param {jQuery} element - jQuery object to make into an Orbit Carousel.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'Orbit'; // ie9 back compat
|
||||||
|
|
||||||
|
_foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied.
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', {
|
||||||
|
'ltr': {
|
||||||
|
'ARROW_RIGHT': 'next',
|
||||||
|
'ARROW_LEFT': 'previous'
|
||||||
|
},
|
||||||
|
'rtl': {
|
||||||
|
'ARROW_LEFT': 'next',
|
||||||
|
'ARROW_RIGHT': 'previous'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
// @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide
|
||||||
|
this._reset();
|
||||||
|
|
||||||
|
this.$wrapper = this.$element.find(".".concat(this.options.containerClass));
|
||||||
|
this.$slides = this.$element.find(".".concat(this.options.slideClass));
|
||||||
|
var $images = this.$element.find('img'),
|
||||||
|
initActive = this.$slides.filter('.is-active'),
|
||||||
|
id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit');
|
||||||
|
this.$element.attr({
|
||||||
|
'data-resize': id,
|
||||||
|
'id': id
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!initActive.length) {
|
||||||
|
this.$slides.eq(0).addClass('is-active');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.options.useMUI) {
|
||||||
|
this.$slides.addClass('no-motionui');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($images.length) {
|
||||||
|
Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this));
|
||||||
|
} else {
|
||||||
|
this._prepareForOrbit(); //hehe
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.bullets) {
|
||||||
|
this._loadBullets();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
|
||||||
|
if (this.options.autoPlay && this.$slides.length > 1) {
|
||||||
|
this.geoSync();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.accessible) {
|
||||||
|
// allow wrapper to be focusable to enable arrow navigation
|
||||||
|
this.$wrapper.attr('tabindex', 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates a jQuery collection of bullets, if they are being used.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_loadBullets",
|
||||||
|
value: function _loadBullets() {
|
||||||
|
this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets a `timer` object on the orbit, and starts the counter for the next slide.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "geoSync",
|
||||||
|
value: function geoSync() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, {
|
||||||
|
duration: this.options.timerDelay,
|
||||||
|
infinite: false
|
||||||
|
}, function () {
|
||||||
|
_this.changeSlide(true);
|
||||||
|
});
|
||||||
|
this.timer.start();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets wrapper and slide heights for the orbit.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_prepareForOrbit",
|
||||||
|
value: function _prepareForOrbit() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this._setWrapperHeight();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {Function} cb - a callback function to fire when complete.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_setWrapperHeight",
|
||||||
|
value: function _setWrapperHeight(cb) {
|
||||||
|
//rewrite this to `for` loop
|
||||||
|
var max = 0,
|
||||||
|
temp,
|
||||||
|
counter = 0,
|
||||||
|
_this = this;
|
||||||
|
|
||||||
|
this.$slides.each(function () {
|
||||||
|
temp = this.getBoundingClientRect().height;
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-slide', counter); // hide all slides but the active one
|
||||||
|
|
||||||
|
if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({
|
||||||
|
'display': 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
max = temp > max ? temp : max;
|
||||||
|
counter++;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (counter === this.$slides.length) {
|
||||||
|
this.$wrapper.css({
|
||||||
|
'height': max
|
||||||
|
}); //only change the wrapper height property once.
|
||||||
|
|
||||||
|
if (cb) {
|
||||||
|
cb(max);
|
||||||
|
} //fire callback with max height dimension.
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets the max-height of each slide.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_setSlideHeight",
|
||||||
|
value: function _setSlideHeight(height) {
|
||||||
|
this.$slides.each(function () {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event listeners to basically everything within the element.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this; //***************************************
|
||||||
|
//**Now using custom event - thanks to:**
|
||||||
|
//** Yohai Ararat of Toronto **
|
||||||
|
//***************************************
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.off('.resizeme.zf.trigger').on({
|
||||||
|
'resizeme.zf.trigger': this._prepareForOrbit.bind(this)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.$slides.length > 1) {
|
||||||
|
if (this.options.swipe) {
|
||||||
|
this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this.changeSlide(true);
|
||||||
|
}).on('swiperight.zf.orbit', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this.changeSlide(false);
|
||||||
|
});
|
||||||
|
} //***************************************
|
||||||
|
|
||||||
|
|
||||||
|
if (this.options.autoPlay) {
|
||||||
|
this.$slides.on('click.zf.orbit', function () {
|
||||||
|
_this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);
|
||||||
|
|
||||||
|
_this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.options.pauseOnHover) {
|
||||||
|
this.$element.on('mouseenter.zf.orbit', function () {
|
||||||
|
_this.timer.pause();
|
||||||
|
}).on('mouseleave.zf.orbit', function () {
|
||||||
|
if (!_this.$element.data('clickedOn')) {
|
||||||
|
_this.timer.start();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.navButtons) {
|
||||||
|
var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass));
|
||||||
|
$controls.attr('tabindex', 0) //also need to handle enter/return and spacebar key presses
|
||||||
|
.on('click.zf.orbit touchend.zf.orbit', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.bullets) {
|
||||||
|
this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () {
|
||||||
|
if (/is-active/g.test(this.className)) {
|
||||||
|
return false;
|
||||||
|
} //if this is active, kick out of function.
|
||||||
|
|
||||||
|
|
||||||
|
var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'),
|
||||||
|
ltr = idx > _this.$slides.filter('.is-active').data('slide'),
|
||||||
|
$slide = _this.$slides.eq(idx);
|
||||||
|
|
||||||
|
_this.changeSlide(ltr, $slide, idx);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.accessible) {
|
||||||
|
this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) {
|
||||||
|
// handle keyboard event with keyboard util
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', {
|
||||||
|
next: function next() {
|
||||||
|
_this.changeSlide(true);
|
||||||
|
},
|
||||||
|
previous: function previous() {
|
||||||
|
_this.changeSlide(false);
|
||||||
|
},
|
||||||
|
handled: function handled() {
|
||||||
|
// if bullet is focused, make sure focus moves
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) {
|
||||||
|
_this.$bullets.filter('.is-active').focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Resets Orbit so it can be reinitialized
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_reset",
|
||||||
|
value: function _reset() {
|
||||||
|
// Don't do anything if there are no slides (first run)
|
||||||
|
if (typeof this.$slides == 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$slides.length > 1) {
|
||||||
|
// Remove old events
|
||||||
|
this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); // Restart timer if autoPlay is enabled
|
||||||
|
|
||||||
|
if (this.options.autoPlay) {
|
||||||
|
this.timer.restart();
|
||||||
|
} // Reset all sliddes
|
||||||
|
|
||||||
|
|
||||||
|
this.$slides.each(function (el) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide();
|
||||||
|
}); // Show the first slide
|
||||||
|
|
||||||
|
this.$slides.first().addClass('is-active').show(); // Triggers when the slide has finished animating
|
||||||
|
|
||||||
|
this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); // Select first bullet if bullets are present
|
||||||
|
|
||||||
|
if (this.options.bullets) {
|
||||||
|
this._updateBullets(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Changes the current slide to a new one.
|
||||||
|
* @function
|
||||||
|
* @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right.
|
||||||
|
* @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.
|
||||||
|
* @param {Number} idx - the index of the new slide in its collection, if one chosen.
|
||||||
|
* @fires Orbit#slidechange
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "changeSlide",
|
||||||
|
value: function changeSlide(isLTR, chosenSlide, idx) {
|
||||||
|
if (!this.$slides) {
|
||||||
|
return;
|
||||||
|
} // Don't freak out if we're in the middle of cleanup
|
||||||
|
|
||||||
|
|
||||||
|
var $curSlide = this.$slides.filter('.is-active').eq(0);
|
||||||
|
|
||||||
|
if (/mui/g.test($curSlide[0].className)) {
|
||||||
|
return false;
|
||||||
|
} //if the slide is currently animating, kick out of the function
|
||||||
|
|
||||||
|
|
||||||
|
var $firstSlide = this.$slides.first(),
|
||||||
|
$lastSlide = this.$slides.last(),
|
||||||
|
dirIn = isLTR ? 'Right' : 'Left',
|
||||||
|
dirOut = isLTR ? 'Left' : 'Right',
|
||||||
|
_this = this,
|
||||||
|
$newSlide;
|
||||||
|
|
||||||
|
if (!chosenSlide) {
|
||||||
|
//most of the time, this will be auto played or clicked from the navButtons.
|
||||||
|
$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!!!!!
|
||||||
|
this.options.infiniteWrap ? $curSlide.next(".".concat(this.options.slideClass)).length ? $curSlide.next(".".concat(this.options.slideClass)) : $firstSlide : $curSlide.next(".".concat(this.options.slideClass)) : //pick next slide if moving left to right
|
||||||
|
this.options.infiniteWrap ? $curSlide.prev(".".concat(this.options.slideClass)).length ? $curSlide.prev(".".concat(this.options.slideClass)) : $lastSlide : $curSlide.prev(".".concat(this.options.slideClass)); //pick prev slide if moving right to left
|
||||||
|
} else {
|
||||||
|
$newSlide = chosenSlide;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($newSlide.length) {
|
||||||
|
/**
|
||||||
|
* Triggers before the next slide starts animating in and only if a next slide has been found.
|
||||||
|
* @event Orbit#beforeslidechange
|
||||||
|
*/
|
||||||
|
this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
|
||||||
|
|
||||||
|
if (this.options.bullets) {
|
||||||
|
idx = idx || this.$slides.index($newSlide); //grab index to update bullets
|
||||||
|
|
||||||
|
this._updateBullets(idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.useMUI && !this.$element.is(':hidden')) {
|
||||||
|
_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () {
|
||||||
|
$newSlide.css({
|
||||||
|
'display': 'block'
|
||||||
|
}).attr('aria-live', 'polite');
|
||||||
|
});
|
||||||
|
_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () {
|
||||||
|
$curSlide.removeAttr('aria-live');
|
||||||
|
|
||||||
|
if (_this.options.autoPlay && !_this.timer.isPaused) {
|
||||||
|
_this.timer.restart();
|
||||||
|
} //do stuff?
|
||||||
|
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();
|
||||||
|
$newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();
|
||||||
|
|
||||||
|
if (this.options.autoPlay && !this.timer.isPaused) {
|
||||||
|
this.timer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Triggers when the slide has finished animating in.
|
||||||
|
* @event Orbit#slidechange
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('slidechange.zf.orbit', [$newSlide]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Updates the active state of the bullets, if displayed.
|
||||||
|
* Move the descriptor of the current slide `[data-slide-active-label]` to the newly active bullet.
|
||||||
|
* If no `[data-slide-active-label]` is set, will move the exceeding `span` element.
|
||||||
|
*
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {Number} idx - the index of the current slide.
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_updateBullets",
|
||||||
|
value: function _updateBullets(idx) {
|
||||||
|
var $oldBullet = this.$bullets.filter('.is-active');
|
||||||
|
var $othersBullets = this.$bullets.not('.is-active');
|
||||||
|
var $newBullet = this.$bullets.eq(idx);
|
||||||
|
$oldBullet.removeClass('is-active').blur();
|
||||||
|
$newBullet.addClass('is-active'); // Find the descriptor for the current slide to move it to the new slide button
|
||||||
|
|
||||||
|
var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last(); // If not explicitely given, search for the last "exceeding" span element (compared to others bullets).
|
||||||
|
|
||||||
|
if (!activeStateDescriptor.length) {
|
||||||
|
var spans = $oldBullet.children('span');
|
||||||
|
var spanCountInOthersBullets = $othersBullets.toArray().map(function (b) {
|
||||||
|
return jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).children('span').length;
|
||||||
|
}); // If there is an exceeding span element, use it as current slide descriptor
|
||||||
|
|
||||||
|
if (spanCountInOthersBullets.every(function (count) {
|
||||||
|
return count < spans.length;
|
||||||
|
})) {
|
||||||
|
activeStateDescriptor = spans.last();
|
||||||
|
activeStateDescriptor.attr('data-slide-active-label', '');
|
||||||
|
}
|
||||||
|
} // Move the current slide descriptor to the new slide button
|
||||||
|
|
||||||
|
|
||||||
|
if (activeStateDescriptor.length) {
|
||||||
|
activeStateDescriptor.detach();
|
||||||
|
$newBullet.append(activeStateDescriptor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys the carousel and hides the element.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Orbit;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["Plugin"]);
|
||||||
|
|
||||||
|
Orbit.defaults = {
|
||||||
|
/**
|
||||||
|
* Tells the JS to look for and loadBullets.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
bullets: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tells the JS to apply event listeners to nav buttons
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
navButtons: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* motion-ui animation class to apply
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'slide-in-right'
|
||||||
|
*/
|
||||||
|
animInFromRight: 'slide-in-right',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* motion-ui animation class to apply
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'slide-out-right'
|
||||||
|
*/
|
||||||
|
animOutToRight: 'slide-out-right',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* motion-ui animation class to apply
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'slide-in-left'
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
animInFromLeft: 'slide-in-left',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* motion-ui animation class to apply
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'slide-out-left'
|
||||||
|
*/
|
||||||
|
animOutToLeft: 'slide-out-left',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows Orbit to automatically animate on page load.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
autoPlay: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of time, in ms, between slide transitions
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 5000
|
||||||
|
*/
|
||||||
|
timerDelay: 5000,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows Orbit to infinitely loop through the slides
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
infiniteWrap: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
swipe: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the timing function to pause animation on hover.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
pauseOnHover: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
accessible: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the container of Orbit
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'orbit-container'
|
||||||
|
*/
|
||||||
|
containerClass: 'orbit-container',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to individual slides.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'orbit-slide'
|
||||||
|
*/
|
||||||
|
slideClass: 'orbit-slide',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the bullet container. You're welcome.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'orbit-bullets'
|
||||||
|
*/
|
||||||
|
boxOfBullets: 'orbit-bullets',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the `next` navigation button.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'orbit-next'
|
||||||
|
*/
|
||||||
|
nextClass: 'orbit-next',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the `previous` navigation button.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'orbit-previous'
|
||||||
|
*/
|
||||||
|
prevClass: 'orbit-previous',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
useMUI: true
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 10:
|
||||||
|
/*!******************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.orbit.js ***!
|
||||||
|
\******************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.orbit.js */"./js/entries/plugins/foundation.orbit.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.orbit.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,585 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.accordion"), require("./foundation.core"), require("./foundation.tabs"), require("./foundation.util.mediaQuery"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.accordion", "./foundation.core", "./foundation.tabs", "./foundation.util.mediaQuery", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.responsiveAccordionTabs"] = factory(require("./foundation.accordion"), require("./foundation.core"), require("./foundation.tabs"), require("./foundation.util.mediaQuery"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.responsiveAccordionTabs"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.accordion"], root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.tabs"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_accordion__, __WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_tabs__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __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 = 11);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./foundation.accordion":
|
||||||
|
/*!************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.accordion"],"amd":"./foundation.accordion","commonjs":"./foundation.accordion","commonjs2":"./foundation.accordion"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_accordion__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.tabs":
|
||||||
|
/*!****************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.tabs"],"amd":"./foundation.tabs","commonjs":"./foundation.tabs","commonjs2":"./foundation.tabs"} ***!
|
||||||
|
\****************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_tabs__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.responsiveAccordionTabs.js":
|
||||||
|
/*!******************************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.responsiveAccordionTabs.js ***!
|
||||||
|
\******************************************************************/
|
||||||
|
/*! exports provided: Foundation, ResponsiveAccordionTabs */
|
||||||
|
/***/ (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_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.responsiveAccordionTabs */ "./js/foundation.responsiveAccordionTabs.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_1__["ResponsiveAccordionTabs"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_1__["ResponsiveAccordionTabs"], 'ResponsiveAccordionTabs');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.responsiveAccordionTabs.js":
|
||||||
|
/*!**************************************************!*\
|
||||||
|
!*** ./js/foundation.responsiveAccordionTabs.js ***!
|
||||||
|
\**************************************************/
|
||||||
|
/*! exports provided: ResponsiveAccordionTabs */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return ResponsiveAccordionTabs; });
|
||||||
|
/* 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_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./foundation.util.mediaQuery");
|
||||||
|
/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.accordion */ "./foundation.accordion");
|
||||||
|
/* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_accordion__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.tabs */ "./foundation.tabs");
|
||||||
|
/* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_tabs__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
|
||||||
|
|
||||||
|
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// The plugin matches the plugin classes with these plugin instances.
|
||||||
|
|
||||||
|
var MenuPlugins = {
|
||||||
|
tabs: {
|
||||||
|
cssClass: 'tabs',
|
||||||
|
plugin: _foundation_tabs__WEBPACK_IMPORTED_MODULE_4__["Tabs"],
|
||||||
|
open: function open(plugin, target) {
|
||||||
|
return plugin.selectTab(target);
|
||||||
|
},
|
||||||
|
close: null
|
||||||
|
/* not supported */
|
||||||
|
,
|
||||||
|
toggle: null
|
||||||
|
/* not supported */
|
||||||
|
|
||||||
|
},
|
||||||
|
accordion: {
|
||||||
|
cssClass: 'accordion',
|
||||||
|
plugin: _foundation_accordion__WEBPACK_IMPORTED_MODULE_3__["Accordion"],
|
||||||
|
open: function open(plugin, target) {
|
||||||
|
return plugin.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target));
|
||||||
|
},
|
||||||
|
close: function close(plugin, target) {
|
||||||
|
return plugin.up(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target));
|
||||||
|
},
|
||||||
|
toggle: function toggle(plugin, target) {
|
||||||
|
return plugin.toggle(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* ResponsiveAccordionTabs module.
|
||||||
|
* @module foundation.responsiveAccordionTabs
|
||||||
|
* @requires foundation.util.motion
|
||||||
|
* @requires foundation.accordion
|
||||||
|
* @requires foundation.tabs
|
||||||
|
*/
|
||||||
|
|
||||||
|
var ResponsiveAccordionTabs =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(ResponsiveAccordionTabs, _Plugin);
|
||||||
|
|
||||||
|
function ResponsiveAccordionTabs(element, options) {
|
||||||
|
var _this2;
|
||||||
|
|
||||||
|
_classCallCheck(this, ResponsiveAccordionTabs);
|
||||||
|
|
||||||
|
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveAccordionTabs).call(this, element, options));
|
||||||
|
return _possibleConstructorReturn(_this2, _this2.options.reflow && _this2.storezfData || _assertThisInitialized(_this2));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates a new instance of a responsive accordion tabs.
|
||||||
|
* @class
|
||||||
|
* @name ResponsiveAccordionTabs
|
||||||
|
* @fires ResponsiveAccordionTabs#init
|
||||||
|
* @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
_createClass(ResponsiveAccordionTabs, [{
|
||||||
|
key: "_setup",
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
|
||||||
|
this.$element.data('zfPluginBase', this);
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveAccordionTabs.defaults, this.$element.data(), options);
|
||||||
|
this.rules = this.$element.data('responsive-accordion-tabs');
|
||||||
|
this.currentMq = null;
|
||||||
|
this.currentRule = null;
|
||||||
|
this.currentPlugin = null;
|
||||||
|
this.className = 'ResponsiveAccordionTabs'; // ie9 back compat
|
||||||
|
|
||||||
|
if (!this.$element.attr('id')) {
|
||||||
|
this.$element.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsiveaccordiontabs'));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof this.rules === 'string') {
|
||||||
|
var rulesTree = {}; // Parse rules from "classes" pulled from data attribute
|
||||||
|
|
||||||
|
var rules = this.rules.split(' '); // Iterate through every rule found
|
||||||
|
|
||||||
|
for (var i = 0; i < rules.length; i++) {
|
||||||
|
var rule = rules[i].split('-');
|
||||||
|
var ruleSize = rule.length > 1 ? rule[0] : 'small';
|
||||||
|
var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
|
||||||
|
|
||||||
|
if (MenuPlugins[rulePlugin] !== null) {
|
||||||
|
rulesTree[ruleSize] = MenuPlugins[rulePlugin];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rules = rulesTree;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._getAllOptions();
|
||||||
|
|
||||||
|
if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) {
|
||||||
|
this._checkMediaQueries();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_getAllOptions",
|
||||||
|
value: function _getAllOptions() {
|
||||||
|
//get all defaults and options
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
_this.allOptions = {};
|
||||||
|
|
||||||
|
for (var key in MenuPlugins) {
|
||||||
|
if (MenuPlugins.hasOwnProperty(key)) {
|
||||||
|
var obj = MenuPlugins[key];
|
||||||
|
|
||||||
|
try {
|
||||||
|
var dummyPlugin = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<ul></ul>');
|
||||||
|
var tmpPlugin = new obj.plugin(dummyPlugin, _this.options);
|
||||||
|
|
||||||
|
for (var keyKey in tmpPlugin.options) {
|
||||||
|
if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') {
|
||||||
|
var objObj = tmpPlugin.options[keyKey];
|
||||||
|
_this.allOptions[keyKey] = objObj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpPlugin.destroy();
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for the Menu.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_checkMediaQueries",
|
||||||
|
value: function _checkMediaQueries() {
|
||||||
|
var matchedMq,
|
||||||
|
_this = this; // Iterate through each rule and find the last matching rule
|
||||||
|
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) {
|
||||||
|
if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) {
|
||||||
|
matchedMq = key;
|
||||||
|
}
|
||||||
|
}); // No match? No dice
|
||||||
|
|
||||||
|
if (!matchedMq) return; // Plugin already initialized? We good
|
||||||
|
|
||||||
|
if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) {
|
||||||
|
_this.$element.removeClass(value.cssClass);
|
||||||
|
}); // Add the CSS class for the new plugin
|
||||||
|
|
||||||
|
this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin
|
||||||
|
|
||||||
|
if (this.currentPlugin) {
|
||||||
|
//don't know why but on nested elements data zfPlugin get's lost
|
||||||
|
if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData);
|
||||||
|
this.currentPlugin.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._handleMarkup(this.rules[matchedMq].cssClass);
|
||||||
|
|
||||||
|
this.currentRule = this.rules[matchedMq];
|
||||||
|
this.currentPlugin = new this.currentRule.plugin(this.$element, this.options);
|
||||||
|
this.storezfData = this.currentPlugin.$element.data('zfPlugin');
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_handleMarkup",
|
||||||
|
value: function _handleMarkup(toSet) {
|
||||||
|
var _this = this,
|
||||||
|
fromString = 'accordion';
|
||||||
|
|
||||||
|
var $panels = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + this.$element.attr('id') + ']');
|
||||||
|
if ($panels.length) fromString = 'tabs';
|
||||||
|
|
||||||
|
if (fromString === toSet) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title';
|
||||||
|
var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel';
|
||||||
|
this.$element.removeAttr('role');
|
||||||
|
var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item');
|
||||||
|
var $liHeadsA = $liHeads.children('a').removeClass('accordion-title');
|
||||||
|
|
||||||
|
if (fromString === 'tabs') {
|
||||||
|
$panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby');
|
||||||
|
$panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');
|
||||||
|
} else {
|
||||||
|
$panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');
|
||||||
|
}
|
||||||
|
|
||||||
|
$panels.css({
|
||||||
|
display: '',
|
||||||
|
visibility: ''
|
||||||
|
});
|
||||||
|
$liHeads.css({
|
||||||
|
display: '',
|
||||||
|
visibility: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
if (toSet === 'accordion') {
|
||||||
|
$panels.each(function (key, value) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({
|
||||||
|
height: ''
|
||||||
|
});
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach();
|
||||||
|
$liHeads.addClass('accordion-item').attr('data-accordion-item', '');
|
||||||
|
$liHeadsA.addClass('accordion-title');
|
||||||
|
});
|
||||||
|
} else if (toSet === 'tabs') {
|
||||||
|
var $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']');
|
||||||
|
var $placeholder = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs-placeholder-' + _this.$element.attr('id'));
|
||||||
|
|
||||||
|
if ($placeholder.length) {
|
||||||
|
$tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id'));
|
||||||
|
$placeholder.remove();
|
||||||
|
} else {
|
||||||
|
$tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$panels.each(function (key, value) {
|
||||||
|
var tempValue = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($tabsContent).addClass(tabsPanel);
|
||||||
|
var hash = $liHeadsA.get(key).hash.slice(1);
|
||||||
|
var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion');
|
||||||
|
|
||||||
|
if (hash !== id) {
|
||||||
|
if (hash !== '') {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash);
|
||||||
|
} else {
|
||||||
|
hash = id;
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href', jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var isActive = jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeads.get(key)).hasClass('is-active');
|
||||||
|
|
||||||
|
if (isActive) {
|
||||||
|
tempValue.addClass('is-active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$liHeads.addClass(tabsTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens the plugin pane defined by `target`.
|
||||||
|
* @param {jQuery | String} target - jQuery object or string of the id of the pane to open.
|
||||||
|
* @see Accordion.down
|
||||||
|
* @see Tabs.selectTab
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "open",
|
||||||
|
value: function open(_target) {
|
||||||
|
if (this.currentRule && typeof this.currentRule.open === 'function') {
|
||||||
|
var _this$currentRule;
|
||||||
|
|
||||||
|
return (_this$currentRule = this.currentRule).open.apply(_this$currentRule, [this.currentPlugin].concat(Array.prototype.slice.call(arguments)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Closes the plugin pane defined by `target`. Not availaible for Tabs.
|
||||||
|
* @param {jQuery | String} target - jQuery object or string of the id of the pane to close.
|
||||||
|
* @see Accordion.up
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "close",
|
||||||
|
value: function close(_target) {
|
||||||
|
if (this.currentRule && typeof this.currentRule.close === 'function') {
|
||||||
|
var _this$currentRule2;
|
||||||
|
|
||||||
|
return (_this$currentRule2 = this.currentRule).close.apply(_this$currentRule2, [this.currentPlugin].concat(Array.prototype.slice.call(arguments)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Toggles the plugin pane defined by `target`. Not availaible for Tabs.
|
||||||
|
* @param {jQuery | String} target - jQuery object or string of the id of the pane to toggle.
|
||||||
|
* @see Accordion.toggle
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "toggle",
|
||||||
|
value: function toggle(_target) {
|
||||||
|
if (this.currentRule && typeof this.currentRule.toggle === 'function') {
|
||||||
|
var _this$currentRule3;
|
||||||
|
|
||||||
|
return (_this$currentRule3 = this.currentRule).toggle.apply(_this$currentRule3, [this.currentPlugin].concat(Array.prototype.slice.call(arguments)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
if (this.currentPlugin) this.currentPlugin.destroy();
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler);
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return ResponsiveAccordionTabs;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
|
||||||
|
|
||||||
|
ResponsiveAccordionTabs.defaults = {};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 11:
|
||||||
|
/*!************************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.responsiveAccordionTabs.js ***!
|
||||||
|
\************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.responsiveAccordionTabs.js */"./js/entries/plugins/foundation.responsiveAccordionTabs.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.responsiveAccordionTabs.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,413 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.accordionMenu"), require("./foundation.core"), require("./foundation.drilldown"), require("./foundation.dropdownMenu"), require("./foundation.util.mediaQuery"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.accordionMenu", "./foundation.core", "./foundation.drilldown", "./foundation.dropdownMenu", "./foundation.util.mediaQuery", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.responsiveMenu"] = factory(require("./foundation.accordionMenu"), require("./foundation.core"), require("./foundation.drilldown"), require("./foundation.dropdownMenu"), require("./foundation.util.mediaQuery"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.responsiveMenu"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.accordionMenu"], root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.drilldown"], root["__FOUNDATION_EXTERNAL__"]["foundation.dropdownMenu"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_accordionMenu__, __WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_drilldown__, __WEBPACK_EXTERNAL_MODULE__foundation_dropdownMenu__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __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 = 12);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./foundation.accordionMenu":
|
||||||
|
/*!****************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.accordionMenu"],"amd":"./foundation.accordionMenu","commonjs":"./foundation.accordionMenu","commonjs2":"./foundation.accordionMenu"} ***!
|
||||||
|
\****************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_accordionMenu__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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.drilldown":
|
||||||
|
/*!************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.drilldown"],"amd":"./foundation.drilldown","commonjs":"./foundation.drilldown","commonjs2":"./foundation.drilldown"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_drilldown__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./foundation.dropdownMenu":
|
||||||
|
/*!************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.dropdownMenu"],"amd":"./foundation.dropdownMenu","commonjs":"./foundation.dropdownMenu","commonjs2":"./foundation.dropdownMenu"} ***!
|
||||||
|
\************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_dropdownMenu__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.responsiveMenu.js":
|
||||||
|
/*!*********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.responsiveMenu.js ***!
|
||||||
|
\*********************************************************/
|
||||||
|
/*! exports provided: Foundation, ResponsiveMenu */
|
||||||
|
/***/ (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_responsiveMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.responsiveMenu */ "./js/foundation.responsiveMenu.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_1__["ResponsiveMenu"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_1__["ResponsiveMenu"], 'ResponsiveMenu');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.responsiveMenu.js":
|
||||||
|
/*!*****************************************!*\
|
||||||
|
!*** ./js/foundation.responsiveMenu.js ***!
|
||||||
|
\*****************************************/
|
||||||
|
/*! exports provided: ResponsiveMenu */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return ResponsiveMenu; });
|
||||||
|
/* 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_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./foundation.util.mediaQuery");
|
||||||
|
/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.dropdownMenu */ "./foundation.dropdownMenu");
|
||||||
|
/* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.drilldown */ "./foundation.drilldown");
|
||||||
|
/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_drilldown__WEBPACK_IMPORTED_MODULE_4__);
|
||||||
|
/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.accordionMenu */ "./foundation.accordionMenu");
|
||||||
|
/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_5__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var MenuPlugins = {
|
||||||
|
dropdown: {
|
||||||
|
cssClass: 'dropdown',
|
||||||
|
plugin: _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_3__["DropdownMenu"]
|
||||||
|
},
|
||||||
|
drilldown: {
|
||||||
|
cssClass: 'drilldown',
|
||||||
|
plugin: _foundation_drilldown__WEBPACK_IMPORTED_MODULE_4__["Drilldown"]
|
||||||
|
},
|
||||||
|
accordion: {
|
||||||
|
cssClass: 'accordion-menu',
|
||||||
|
plugin: _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_5__["AccordionMenu"]
|
||||||
|
}
|
||||||
|
}; // import "foundation.util.triggers.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ResponsiveMenu module.
|
||||||
|
* @module foundation.responsiveMenu
|
||||||
|
* @requires foundation.util.triggers
|
||||||
|
* @requires foundation.util.mediaQuery
|
||||||
|
*/
|
||||||
|
|
||||||
|
var ResponsiveMenu =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(ResponsiveMenu, _Plugin);
|
||||||
|
|
||||||
|
function ResponsiveMenu() {
|
||||||
|
_classCallCheck(this, ResponsiveMenu);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveMenu).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ResponsiveMenu, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of a responsive menu.
|
||||||
|
* @class
|
||||||
|
* @name ResponsiveMenu
|
||||||
|
* @fires ResponsiveMenu#init
|
||||||
|
* @param {jQuery} element - jQuery object to make into a dropdown menu.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
|
||||||
|
this.rules = this.$element.data('responsive-menu');
|
||||||
|
this.currentMq = null;
|
||||||
|
this.currentPlugin = null;
|
||||||
|
this.className = 'ResponsiveMenu'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof this.rules === 'string') {
|
||||||
|
var rulesTree = {}; // Parse rules from "classes" pulled from data attribute
|
||||||
|
|
||||||
|
var rules = this.rules.split(' '); // Iterate through every rule found
|
||||||
|
|
||||||
|
for (var i = 0; i < rules.length; i++) {
|
||||||
|
var rule = rules[i].split('-');
|
||||||
|
var ruleSize = rule.length > 1 ? rule[0] : 'small';
|
||||||
|
var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
|
||||||
|
|
||||||
|
if (MenuPlugins[rulePlugin] !== null) {
|
||||||
|
rulesTree[ruleSize] = MenuPlugins[rulePlugin];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rules = rulesTree;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) {
|
||||||
|
this._checkMediaQueries();
|
||||||
|
} // Add data-mutate since children may need it.
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.attr('data-mutate', this.$element.attr('data-mutate') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsive-menu'));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for the Menu.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () {
|
||||||
|
_this._checkMediaQueries();
|
||||||
|
}); // $(window).on('resize.zf.ResponsiveMenu', function() {
|
||||||
|
// _this._checkMediaQueries();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_checkMediaQueries",
|
||||||
|
value: function _checkMediaQueries() {
|
||||||
|
var matchedMq,
|
||||||
|
_this = this; // Iterate through each rule and find the last matching rule
|
||||||
|
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) {
|
||||||
|
if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) {
|
||||||
|
matchedMq = key;
|
||||||
|
}
|
||||||
|
}); // No match? No dice
|
||||||
|
|
||||||
|
if (!matchedMq) return; // Plugin already initialized? We good
|
||||||
|
|
||||||
|
if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) {
|
||||||
|
_this.$element.removeClass(value.cssClass);
|
||||||
|
}); // Add the CSS class for the new plugin
|
||||||
|
|
||||||
|
this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin
|
||||||
|
|
||||||
|
if (this.currentPlugin) this.currentPlugin.destroy();
|
||||||
|
this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.currentPlugin.destroy();
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('.zf.ResponsiveMenu');
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return ResponsiveMenu;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
|
||||||
|
|
||||||
|
ResponsiveMenu.defaults = {};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 12:
|
||||||
|
/*!***************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.responsiveMenu.js ***!
|
||||||
|
\***************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.responsiveMenu.js */"./js/entries/plugins/foundation.responsiveMenu.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.responsiveMenu.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,394 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.mediaQuery", "./foundation.util.motion", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.responsiveToggle"] = factory(require("./foundation.core"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.responsiveToggle"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __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 = 13);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.responsiveToggle.js":
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.responsiveToggle.js ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/*! exports provided: Foundation, ResponsiveToggle */
|
||||||
|
/***/ (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_responsiveToggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.responsiveToggle */ "./js/foundation.responsiveToggle.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_1__["ResponsiveToggle"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_1__["ResponsiveToggle"], 'ResponsiveToggle');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.responsiveToggle.js":
|
||||||
|
/*!*******************************************!*\
|
||||||
|
!*** ./js/foundation.responsiveToggle.js ***!
|
||||||
|
\*******************************************/
|
||||||
|
/*! exports provided: ResponsiveToggle */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return ResponsiveToggle; });
|
||||||
|
/* 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_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./foundation.util.mediaQuery");
|
||||||
|
/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_mediaQuery__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__);
|
||||||
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ResponsiveToggle module.
|
||||||
|
* @module foundation.responsiveToggle
|
||||||
|
* @requires foundation.util.mediaQuery
|
||||||
|
* @requires foundation.util.motion
|
||||||
|
*/
|
||||||
|
|
||||||
|
var ResponsiveToggle =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(ResponsiveToggle, _Plugin);
|
||||||
|
|
||||||
|
function ResponsiveToggle() {
|
||||||
|
_classCallCheck(this, ResponsiveToggle);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveToggle).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ResponsiveToggle, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of Tab Bar.
|
||||||
|
* @class
|
||||||
|
* @name ResponsiveToggle
|
||||||
|
* @fires ResponsiveToggle#init
|
||||||
|
* @param {jQuery} element - jQuery object to attach tab bar functionality to.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'ResponsiveToggle'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the tab bar by finding the target element, toggling element, and running update().
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
|
||||||
|
|
||||||
|
var targetID = this.$element.data('responsive-toggle');
|
||||||
|
|
||||||
|
if (!targetID) {
|
||||||
|
console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$targetMenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetID));
|
||||||
|
this.$toggler = this.$element.find('[data-toggle]').filter(function () {
|
||||||
|
var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
|
||||||
|
return target === targetID || target === "";
|
||||||
|
});
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes
|
||||||
|
|
||||||
|
if (this.options.animate) {
|
||||||
|
var input = this.options.animate.split(' ');
|
||||||
|
this.animationIn = input[0];
|
||||||
|
this.animationOut = input[1] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._update();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds necessary event handlers for the tab bar to work.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this._updateMqHandler = this._update.bind(this);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._updateMqHandler);
|
||||||
|
this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Checks the current media query to determine if the tab bar should be visible or hidden.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_update",
|
||||||
|
value: function _update() {
|
||||||
|
// Mobile
|
||||||
|
if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) {
|
||||||
|
this.$element.show();
|
||||||
|
this.$targetMenu.hide();
|
||||||
|
} // Desktop
|
||||||
|
else {
|
||||||
|
this.$element.hide();
|
||||||
|
this.$targetMenu.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.
|
||||||
|
* @function
|
||||||
|
* @fires ResponsiveToggle#toggled
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "toggleMenu",
|
||||||
|
value: function toggleMenu() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) {
|
||||||
|
/**
|
||||||
|
* Fires when the element attached to the tab bar toggles.
|
||||||
|
* @event ResponsiveToggle#toggled
|
||||||
|
*/
|
||||||
|
if (this.options.animate) {
|
||||||
|
if (this.$targetMenu.is(':hidden')) {
|
||||||
|
_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () {
|
||||||
|
_this2.$element.trigger('toggled.zf.responsiveToggle');
|
||||||
|
|
||||||
|
_this2.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () {
|
||||||
|
_this2.$element.trigger('toggled.zf.responsiveToggle');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$targetMenu.toggle(0);
|
||||||
|
this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||||
|
this.$element.trigger('toggled.zf.responsiveToggle');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.off('.zf.responsiveToggle');
|
||||||
|
this.$toggler.off('.zf.responsiveToggle');
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._updateMqHandler);
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return ResponsiveToggle;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
|
||||||
|
|
||||||
|
ResponsiveToggle.defaults = {
|
||||||
|
/**
|
||||||
|
* The breakpoint after which the menu is always shown, and the tab bar is hidden.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'medium'
|
||||||
|
*/
|
||||||
|
hideFor: 'medium',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To decide if the toggle should be animated or not.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
animate: false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 13:
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.responsiveToggle.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.responsiveToggle.js */"./js/entries/plugins/foundation.responsiveToggle.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.responsiveToggle.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,359 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.smoothScroll"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.smoothScroll"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 16);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.smoothScroll.js":
|
||||||
|
/*!*******************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.smoothScroll.js ***!
|
||||||
|
\*******************************************************/
|
||||||
|
/*! exports provided: Foundation, SmoothScroll */
|
||||||
|
/***/ (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_smoothScroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.smoothScroll */ "./js/foundation.smoothScroll.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_1__["SmoothScroll"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_1__["SmoothScroll"], 'SmoothScroll');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.smoothScroll.js":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** ./js/foundation.smoothScroll.js ***!
|
||||||
|
\***************************************/
|
||||||
|
/*! exports provided: SmoothScroll */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return SmoothScroll; });
|
||||||
|
/* 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__);
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SmoothScroll module.
|
||||||
|
* @module foundation.smoothScroll
|
||||||
|
*/
|
||||||
|
|
||||||
|
var SmoothScroll =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(SmoothScroll, _Plugin);
|
||||||
|
|
||||||
|
function SmoothScroll() {
|
||||||
|
_classCallCheck(this, SmoothScroll);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(SmoothScroll).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(SmoothScroll, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of SmoothScroll.
|
||||||
|
* @class
|
||||||
|
* @name SmoothScroll
|
||||||
|
* @fires SmoothScroll#init
|
||||||
|
* @param {Object} element - jQuery object to add the trigger to.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'SmoothScroll'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initialize the SmoothScroll plugin
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'smooth-scroll');
|
||||||
|
this.$element.attr({
|
||||||
|
id: id
|
||||||
|
});
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for SmoothScroll.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
this._linkClickListener = this._handleLinkClick.bind(this);
|
||||||
|
this.$element.on('click.zf.smoothScroll', this._linkClickListener);
|
||||||
|
this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Handle the given event to smoothly scroll to the anchor pointed by the event target.
|
||||||
|
* @param {*} e - event
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_handleLinkClick",
|
||||||
|
value: function _handleLinkClick(e) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
// Follow the link if it does not point to an anchor.
|
||||||
|
if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget).is('a[href^="#"]')) return;
|
||||||
|
var arrival = e.currentTarget.getAttribute('href');
|
||||||
|
this._inTransition = true;
|
||||||
|
SmoothScroll.scrollToLoc(arrival, this.options, function () {
|
||||||
|
_this._inTransition = false;
|
||||||
|
});
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroys the SmoothScroll instance.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.off('click.zf.smoothScroll', this._linkClickListener);
|
||||||
|
this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
|
||||||
|
}
|
||||||
|
}], [{
|
||||||
|
key: "scrollToLoc",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to scroll to a given location on the page.
|
||||||
|
* @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'
|
||||||
|
* @param {Object} options - The options to use.
|
||||||
|
* @param {Function} callback - The callback function.
|
||||||
|
* @static
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
value: function scrollToLoc(loc) {
|
||||||
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults;
|
||||||
|
var callback = arguments.length > 2 ? arguments[2] : undefined;
|
||||||
|
var $loc = jquery__WEBPACK_IMPORTED_MODULE_0___default()(loc); // Do nothing if target does not exist to prevent errors
|
||||||
|
|
||||||
|
if (!$loc.length) return false;
|
||||||
|
var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({
|
||||||
|
scrollTop: scrollPos
|
||||||
|
}, options.animationDuration, options.animationEasing, function () {
|
||||||
|
if (typeof callback === 'function') {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return SmoothScroll;
|
||||||
|
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
||||||
|
/**
|
||||||
|
* Default settings for plugin.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
SmoothScroll.defaults = {
|
||||||
|
/**
|
||||||
|
* Amount of time, in ms, the animated scrolling should take between locations.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 500
|
||||||
|
*/
|
||||||
|
animationDuration: 500,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'linear'
|
||||||
|
* @see {@link https://api.jquery.com/animate|Jquery animate}
|
||||||
|
*/
|
||||||
|
animationEasing: 'linear',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of pixels to use as a marker for location changes.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 50
|
||||||
|
*/
|
||||||
|
threshold: 50,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 0
|
||||||
|
*/
|
||||||
|
offset: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 16:
|
||||||
|
/*!*************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.smoothScroll.js ***!
|
||||||
|
\*************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.smoothScroll.js */"./js/entries/plugins/foundation.smoothScroll.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.smoothScroll.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,792 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.keyboard"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.imageLoader", "./foundation.util.keyboard", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.tabs"] = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.keyboard"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.tabs"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.imageLoader"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __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 = 18);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.imageLoader":
|
||||||
|
/*!****************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.imageLoader"],"amd":"./foundation.util.imageLoader","commonjs":"./foundation.util.imageLoader","commonjs2":"./foundation.util.imageLoader"} ***!
|
||||||
|
\****************************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.tabs.js":
|
||||||
|
/*!***********************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.tabs.js ***!
|
||||||
|
\***********************************************/
|
||||||
|
/*! exports provided: Foundation, Tabs */
|
||||||
|
/***/ (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_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.tabs */ "./js/foundation.tabs.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return _foundation_tabs__WEBPACK_IMPORTED_MODULE_1__["Tabs"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_tabs__WEBPACK_IMPORTED_MODULE_1__["Tabs"], 'Tabs');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.tabs.js":
|
||||||
|
/*!*******************************!*\
|
||||||
|
!*** ./js/foundation.tabs.js ***!
|
||||||
|
\*******************************/
|
||||||
|
/*! exports provided: Tabs */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; });
|
||||||
|
/* 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_imageLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./foundation.util.imageLoader");
|
||||||
|
/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3__);
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tabs module.
|
||||||
|
* @module foundation.tabs
|
||||||
|
* @requires foundation.util.keyboard
|
||||||
|
* @requires foundation.util.imageLoader if tabs contain images
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Tabs =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Tabs, _Plugin);
|
||||||
|
|
||||||
|
function Tabs() {
|
||||||
|
_classCallCheck(this, Tabs);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Tabs).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Tabs, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of tabs.
|
||||||
|
* @class
|
||||||
|
* @name Tabs
|
||||||
|
* @fires Tabs#init
|
||||||
|
* @param {jQuery} element - jQuery object to make into tabs.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tabs.defaults, this.$element.data(), options);
|
||||||
|
this.className = 'Tabs'; // ie9 back compat
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Tabs', {
|
||||||
|
'ENTER': 'open',
|
||||||
|
'SPACE': 'open',
|
||||||
|
'ARROW_RIGHT': 'next',
|
||||||
|
'ARROW_UP': 'previous',
|
||||||
|
'ARROW_DOWN': 'next',
|
||||||
|
'ARROW_LEFT': 'previous' // 'TAB': 'next',
|
||||||
|
// 'SHIFT_TAB': 'previous'
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this._isInitializing = true;
|
||||||
|
this.$element.attr({
|
||||||
|
'role': 'tablist'
|
||||||
|
});
|
||||||
|
this.$tabTitles = this.$element.find(".".concat(this.options.linkClass));
|
||||||
|
this.$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-tabs-content=\"".concat(this.$element[0].id, "\"]"));
|
||||||
|
this.$tabTitles.each(function () {
|
||||||
|
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$link = $elem.find('a'),
|
||||||
|
isActive = $elem.hasClass("".concat(_this.options.linkActiveClass)),
|
||||||
|
hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1),
|
||||||
|
linkId = $link[0].id ? $link[0].id : "".concat(hash, "-label"),
|
||||||
|
$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(hash));
|
||||||
|
$elem.attr({
|
||||||
|
'role': 'presentation'
|
||||||
|
});
|
||||||
|
$link.attr({
|
||||||
|
'role': 'tab',
|
||||||
|
'aria-controls': hash,
|
||||||
|
'aria-selected': isActive,
|
||||||
|
'id': linkId,
|
||||||
|
'tabindex': isActive ? '0' : '-1'
|
||||||
|
});
|
||||||
|
$tabContent.attr({
|
||||||
|
'role': 'tabpanel',
|
||||||
|
'aria-labelledby': linkId
|
||||||
|
}); // Save up the initial hash to return to it later when going back in history
|
||||||
|
|
||||||
|
if (isActive) {
|
||||||
|
_this._initialAnchor = "#".concat(hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isActive) {
|
||||||
|
$tabContent.attr('aria-hidden', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isActive && _this.options.autoFocus) {
|
||||||
|
_this.onLoadListener = Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
|
||||||
|
scrollTop: $elem.offset().top
|
||||||
|
}, _this.options.deepLinkSmudgeDelay, function () {
|
||||||
|
$link.focus();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.options.matchHeight) {
|
||||||
|
var $images = this.$tabContent.find('img');
|
||||||
|
|
||||||
|
if ($images.length) {
|
||||||
|
Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3__["onImagesLoaded"])($images, this._setHeight.bind(this));
|
||||||
|
} else {
|
||||||
|
this._setHeight();
|
||||||
|
}
|
||||||
|
} // Current context-bound function to open tabs on page load or history hashchange
|
||||||
|
|
||||||
|
|
||||||
|
this._checkDeepLink = function () {
|
||||||
|
var anchor = window.location.hash;
|
||||||
|
|
||||||
|
if (!anchor.length) {
|
||||||
|
// If we are still initializing and there is no anchor, then there is nothing to do
|
||||||
|
if (_this2._isInitializing) return; // Otherwise, move to the initial anchor
|
||||||
|
|
||||||
|
if (_this2._initialAnchor) anchor = _this2._initialAnchor;
|
||||||
|
}
|
||||||
|
|
||||||
|
var anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor;
|
||||||
|
var $anchor = anchorNoHash && jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(anchorNoHash));
|
||||||
|
|
||||||
|
var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"],[data-tabs-target=\"").concat(anchorNoHash, "\"]")).first(); // Whether the anchor element that has been found is part of this element
|
||||||
|
|
||||||
|
|
||||||
|
var isOwnAnchor = !!($anchor.length && $link.length);
|
||||||
|
|
||||||
|
if (isOwnAnchor) {
|
||||||
|
// If there is an anchor for the hash, select it
|
||||||
|
if ($anchor && $anchor.length && $link && $link.length) {
|
||||||
|
_this2.selectTab($anchor, true);
|
||||||
|
} // Otherwise, collapse everything
|
||||||
|
else {
|
||||||
|
_this2._collapse();
|
||||||
|
} // Roll up a little to show the titles
|
||||||
|
|
||||||
|
|
||||||
|
if (_this2.options.deepLinkSmudge) {
|
||||||
|
var offset = _this2.$element.offset();
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
|
||||||
|
scrollTop: offset.top
|
||||||
|
}, _this2.options.deepLinkSmudgeDelay);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the plugin has deeplinked at pageload
|
||||||
|
* @event Tabs#deeplink
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
_this2.$element.trigger('deeplink.zf.tabs', [$link, $anchor]);
|
||||||
|
}
|
||||||
|
}; //use browser to open a tab, if it exists in this tabset
|
||||||
|
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
this._checkDeepLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
|
||||||
|
this._isInitializing = false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds event handlers for items within the tabs.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
this._addKeyHandler();
|
||||||
|
|
||||||
|
this._addClickHandler();
|
||||||
|
|
||||||
|
this._setHeightMqHandler = null;
|
||||||
|
|
||||||
|
if (this.options.matchHeight) {
|
||||||
|
this._setHeightMqHandler = this._setHeight.bind(this);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds click handlers for items within the tabs.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_addClickHandler",
|
||||||
|
value: function _addClickHandler() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$element.off('click.zf.tabs').on('click.zf.tabs', ".".concat(this.options.linkClass), function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
_this._handleTabChange(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds keyboard event handlers for items within the tabs.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_addKeyHandler",
|
||||||
|
value: function _addKeyHandler() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) {
|
||||||
|
if (e.which === 9) return;
|
||||||
|
var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$elements = $element.parent('ul').children('li'),
|
||||||
|
$prevElement,
|
||||||
|
$nextElement;
|
||||||
|
$elements.each(function (i) {
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
|
||||||
|
if (_this.options.wrapOnKeys) {
|
||||||
|
$prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1);
|
||||||
|
$nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1);
|
||||||
|
} else {
|
||||||
|
$prevElement = $elements.eq(Math.max(0, i - 1));
|
||||||
|
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}); // handle keyboard event with keyboard util
|
||||||
|
|
||||||
|
_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Tabs', {
|
||||||
|
open: function open() {
|
||||||
|
$element.find('[role="tab"]').focus();
|
||||||
|
|
||||||
|
_this._handleTabChange($element);
|
||||||
|
},
|
||||||
|
previous: function previous() {
|
||||||
|
$prevElement.find('[role="tab"]').focus();
|
||||||
|
|
||||||
|
_this._handleTabChange($prevElement);
|
||||||
|
},
|
||||||
|
next: function next() {
|
||||||
|
$nextElement.find('[role="tab"]').focus();
|
||||||
|
|
||||||
|
_this._handleTabChange($nextElement);
|
||||||
|
},
|
||||||
|
handled: function handled() {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens the tab `$targetContent` defined by `$target`. Collapses active tab.
|
||||||
|
* @param {jQuery} $target - Tab to open.
|
||||||
|
* @param {boolean} historyHandled - browser has already handled a history update
|
||||||
|
* @fires Tabs#change
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_handleTabChange",
|
||||||
|
value: function _handleTabChange($target, historyHandled) {
|
||||||
|
// With `activeCollapse`, if the target is the active Tab, collapse it.
|
||||||
|
if ($target.hasClass("".concat(this.options.linkActiveClass))) {
|
||||||
|
if (this.options.activeCollapse) {
|
||||||
|
this._collapse();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var $oldTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)),
|
||||||
|
$tabLink = $target.find('[role="tab"]'),
|
||||||
|
target = $tabLink.attr('data-tabs-target'),
|
||||||
|
anchor = target && target.length ? "#".concat(target) : $tabLink[0].hash,
|
||||||
|
$targetContent = this.$tabContent.find(anchor); //close old tab
|
||||||
|
|
||||||
|
this._collapseTab($oldTab); //open new tab
|
||||||
|
|
||||||
|
|
||||||
|
this._openTab($target); //either replace or update browser history
|
||||||
|
|
||||||
|
|
||||||
|
if (this.options.deepLink && !historyHandled) {
|
||||||
|
if (this.options.updateHistory) {
|
||||||
|
history.pushState({}, '', anchor);
|
||||||
|
} else {
|
||||||
|
history.replaceState({}, '', anchor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Fires when the plugin has successfully changed tabs.
|
||||||
|
* @event Tabs#change
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('change.zf.tabs', [$target, $targetContent]); //fire to children a mutation event
|
||||||
|
|
||||||
|
$targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Opens the tab `$targetContent` defined by `$target`.
|
||||||
|
* @param {jQuery} $target - Tab to open.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_openTab",
|
||||||
|
value: function _openTab($target) {
|
||||||
|
var $tabLink = $target.find('[role="tab"]'),
|
||||||
|
hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),
|
||||||
|
$targetContent = this.$tabContent.find("#".concat(hash));
|
||||||
|
$target.addClass("".concat(this.options.linkActiveClass));
|
||||||
|
$tabLink.attr({
|
||||||
|
'aria-selected': 'true',
|
||||||
|
'tabindex': '0'
|
||||||
|
});
|
||||||
|
$targetContent.addClass("".concat(this.options.panelActiveClass)).removeAttr('aria-hidden');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Collapses `$targetContent` defined by `$target`.
|
||||||
|
* @param {jQuery} $target - Tab to collapse.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_collapseTab",
|
||||||
|
value: function _collapseTab($target) {
|
||||||
|
var $target_anchor = $target.removeClass("".concat(this.options.linkActiveClass)).find('[role="tab"]').attr({
|
||||||
|
'aria-selected': 'false',
|
||||||
|
'tabindex': -1
|
||||||
|
});
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat($target_anchor.attr('aria-controls'))).removeClass("".concat(this.options.panelActiveClass)).attr({
|
||||||
|
'aria-hidden': 'true'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Collapses the active Tab.
|
||||||
|
* @fires Tabs#collapse
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_collapse",
|
||||||
|
value: function _collapse() {
|
||||||
|
var $activeTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass));
|
||||||
|
|
||||||
|
if ($activeTab.length) {
|
||||||
|
this._collapseTab($activeTab);
|
||||||
|
/**
|
||||||
|
* Fires when the plugin has successfully collapsed tabs.
|
||||||
|
* @event Tabs#collapse
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.$element.trigger('collapse.zf.tabs', [$activeTab]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Public method for selecting a content pane to display.
|
||||||
|
* @param {jQuery | String} elem - jQuery object or string of the id of the pane to display.
|
||||||
|
* @param {boolean} historyHandled - browser has already handled a history update
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "selectTab",
|
||||||
|
value: function selectTab(elem, historyHandled) {
|
||||||
|
var idStr, hashIdStr;
|
||||||
|
|
||||||
|
if (_typeof(elem) === 'object') {
|
||||||
|
idStr = elem[0].id;
|
||||||
|
} else {
|
||||||
|
idStr = elem;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idStr.indexOf('#') < 0) {
|
||||||
|
hashIdStr = "#".concat(idStr);
|
||||||
|
} else {
|
||||||
|
hashIdStr = idStr;
|
||||||
|
idStr = idStr.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var $target = this.$tabTitles.has("[href$=\"".concat(hashIdStr, "\"],[data-tabs-target=\"").concat(idStr, "\"]")).first();
|
||||||
|
|
||||||
|
this._handleTabChange($target, historyHandled);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_setHeight",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the height of each panel to the height of the tallest panel.
|
||||||
|
* If enabled in options, gets called on media query change.
|
||||||
|
* If loading content via external source, can be called directly or with _reflow.
|
||||||
|
* If enabled with `data-match-height="true"`, tabs sets to equal height
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
value: function _setHeight() {
|
||||||
|
var max = 0,
|
||||||
|
_this = this; // Lock down the `this` value for the root tabs object
|
||||||
|
|
||||||
|
|
||||||
|
this.$tabContent.find(".".concat(this.options.panelClass)).css('height', '').each(function () {
|
||||||
|
var panel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
isActive = panel.hasClass("".concat(_this.options.panelActiveClass)); // get the options from the parent instead of trying to get them from the child
|
||||||
|
|
||||||
|
if (!isActive) {
|
||||||
|
panel.css({
|
||||||
|
'visibility': 'hidden',
|
||||||
|
'display': 'block'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var temp = this.getBoundingClientRect().height;
|
||||||
|
|
||||||
|
if (!isActive) {
|
||||||
|
panel.css({
|
||||||
|
'visibility': '',
|
||||||
|
'display': ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
max = temp > max ? temp : max;
|
||||||
|
}).css('height', "".concat(max, "px"));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys an instance of tabs.
|
||||||
|
* @fires Tabs#destroyed
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.find(".".concat(this.options.linkClass)).off('.zf.tabs').hide().end().find(".".concat(this.options.panelClass)).hide();
|
||||||
|
|
||||||
|
if (this.options.matchHeight) {
|
||||||
|
if (this._setHeightMqHandler != null) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.deepLink) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.onLoadListener) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Tabs;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
||||||
|
|
||||||
|
Tabs.defaults = {
|
||||||
|
/**
|
||||||
|
* Link the location hash to the active pane.
|
||||||
|
* Set the location hash when the active pane changes, and open the corresponding pane when the location changes.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
deepLink: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
deepLinkSmudge: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment
|
||||||
|
* @option
|
||||||
|
* @type {number}
|
||||||
|
* @default 300
|
||||||
|
*/
|
||||||
|
deepLinkSmudgeDelay: 300,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `deepLink` is enabled, update the browser history with the open tab
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
updateHistory: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the window to scroll to content of active pane on load.
|
||||||
|
* Not recommended if more than one tab panel per page.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
autoFocus: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows keyboard input to 'wrap' around the tab links.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
wrapOnKeys: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the tab content panes to match heights if set to true.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
matchHeight: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows active tabs to collapse when clicked.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
activeCollapse: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to `li`'s in tab link list.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'tabs-title'
|
||||||
|
*/
|
||||||
|
linkClass: 'tabs-title',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the active `li` in tab link list.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'is-active'
|
||||||
|
*/
|
||||||
|
linkActiveClass: 'is-active',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the content containers.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'tabs-panel'
|
||||||
|
*/
|
||||||
|
panelClass: 'tabs-panel',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class applied to the active content container.
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
* @default 'is-active'
|
||||||
|
*/
|
||||||
|
panelActiveClass: 'is-active'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 18:
|
||||||
|
/*!*****************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.tabs.js ***!
|
||||||
|
\*****************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.tabs.js */"./js/entries/plugins/foundation.tabs.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.tabs.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,704 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.motion", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.toggler"] = factory(require("./foundation.core"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.toggler"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __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 = 19);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.toggler.js":
|
||||||
|
/*!**************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.toggler.js ***!
|
||||||
|
\**************************************************/
|
||||||
|
/*! exports provided: Foundation, Toggler */
|
||||||
|
/***/ (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_toggler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.toggler */ "./js/foundation.toggler.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return _foundation_toggler__WEBPACK_IMPORTED_MODULE_1__["Toggler"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_toggler__WEBPACK_IMPORTED_MODULE_1__["Toggler"], 'Toggler');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.toggler.js":
|
||||||
|
/*!**********************************!*\
|
||||||
|
!*** ./js/foundation.toggler.js ***!
|
||||||
|
\**********************************/
|
||||||
|
/*! exports provided: Toggler */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return Toggler; });
|
||||||
|
/* 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_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.motion */ "./foundation.util.motion");
|
||||||
|
/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
|
||||||
|
|
||||||
|
|
||||||
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggler module.
|
||||||
|
* @module foundation.toggler
|
||||||
|
* @requires foundation.util.motion
|
||||||
|
* @requires foundation.util.triggers
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Toggler =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Plugin) {
|
||||||
|
_inherits(Toggler, _Plugin);
|
||||||
|
|
||||||
|
function Toggler() {
|
||||||
|
_classCallCheck(this, Toggler);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(Toggler).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Toggler, [{
|
||||||
|
key: "_setup",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of Toggler.
|
||||||
|
* @class
|
||||||
|
* @name Toggler
|
||||||
|
* @fires Toggler#init
|
||||||
|
* @param {Object} element - jQuery object to add the trigger to.
|
||||||
|
* @param {Object} options - Overrides to the default plugin settings.
|
||||||
|
*/
|
||||||
|
value: function _setup(element, options) {
|
||||||
|
this.$element = element;
|
||||||
|
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Toggler.defaults, element.data(), options);
|
||||||
|
this.className = '';
|
||||||
|
this.className = 'Toggler'; // ie9 back compat
|
||||||
|
// Triggers init is idempotent, just need to make sure it is initialized
|
||||||
|
|
||||||
|
_foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
|
||||||
|
this._events();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
// Collect triggers to set ARIA attributes to
|
||||||
|
var id = this.$element[0].id,
|
||||||
|
$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open~=\"".concat(id, "\"], [data-close~=\"").concat(id, "\"], [data-toggle~=\"").concat(id, "\"]"));
|
||||||
|
var input; // Parse animation classes if they were set
|
||||||
|
|
||||||
|
if (this.options.animate) {
|
||||||
|
input = this.options.animate.split(' ');
|
||||||
|
this.animationIn = input[0];
|
||||||
|
this.animationOut = input[1] || null; // - aria-expanded: according to the element visibility.
|
||||||
|
|
||||||
|
$triggers.attr('aria-expanded', !this.$element.is(':hidden'));
|
||||||
|
} // Otherwise, parse toggle class
|
||||||
|
else {
|
||||||
|
input = this.options.toggler;
|
||||||
|
|
||||||
|
if (typeof input !== 'string' || !input.length) {
|
||||||
|
throw new Error("The 'toogler' option containing the target class is required, got \"".concat(input, "\""));
|
||||||
|
} // Allow for a . at the beginning of the string
|
||||||
|
|
||||||
|
|
||||||
|
this.className = input[0] === '.' ? input.slice(1) : input; // - aria-expanded: according to the elements class set.
|
||||||
|
|
||||||
|
$triggers.attr('aria-expanded', this.$element.hasClass(this.className));
|
||||||
|
} // - aria-controls: adding the element id to it if not already in it.
|
||||||
|
|
||||||
|
|
||||||
|
$triggers.each(function (index, trigger) {
|
||||||
|
var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger);
|
||||||
|
var controls = $trigger.attr('aria-controls') || '';
|
||||||
|
var containsId = new RegExp("\\b".concat(Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"])(id), "\\b")).test(controls);
|
||||||
|
if (!containsId) $trigger.attr('aria-controls', controls ? "".concat(controls, " ").concat(id) : id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Initializes events for the toggle trigger.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_events",
|
||||||
|
value: function _events() {
|
||||||
|
this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 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".
|
||||||
|
* @function
|
||||||
|
* @fires Toggler#on
|
||||||
|
* @fires Toggler#off
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "toggle",
|
||||||
|
value: function toggle() {
|
||||||
|
this[this.options.animate ? '_toggleAnimate' : '_toggleClass']();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_toggleClass",
|
||||||
|
value: function _toggleClass() {
|
||||||
|
this.$element.toggleClass(this.className);
|
||||||
|
var isOn = this.$element.hasClass(this.className);
|
||||||
|
|
||||||
|
if (isOn) {
|
||||||
|
/**
|
||||||
|
* Fires if the target element has the class after a toggle.
|
||||||
|
* @event Toggler#on
|
||||||
|
*/
|
||||||
|
this.$element.trigger('on.zf.toggler');
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Fires if the target element does not have the class after a toggle.
|
||||||
|
* @event Toggler#off
|
||||||
|
*/
|
||||||
|
this.$element.trigger('off.zf.toggler');
|
||||||
|
}
|
||||||
|
|
||||||
|
this._updateARIA(isOn);
|
||||||
|
|
||||||
|
this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_toggleAnimate",
|
||||||
|
value: function _toggleAnimate() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
if (this.$element.is(':hidden')) {
|
||||||
|
_foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateIn(this.$element, this.animationIn, function () {
|
||||||
|
_this._updateARIA(true);
|
||||||
|
|
||||||
|
this.trigger('on.zf.toggler');
|
||||||
|
this.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateOut(this.$element, this.animationOut, function () {
|
||||||
|
_this._updateARIA(false);
|
||||||
|
|
||||||
|
this.trigger('off.zf.toggler');
|
||||||
|
this.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_updateARIA",
|
||||||
|
value: function _updateARIA(isOn) {
|
||||||
|
var id = this.$element[0].id;
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(id, "\"], [data-close=\"").concat(id, "\"], [data-toggle=\"").concat(id, "\"]")).attr({
|
||||||
|
'aria-expanded': isOn ? true : false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destroys the instance of Toggler on the element.
|
||||||
|
* @function
|
||||||
|
*/
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "_destroy",
|
||||||
|
value: function _destroy() {
|
||||||
|
this.$element.off('.zf.toggler');
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return Toggler;
|
||||||
|
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
|
||||||
|
|
||||||
|
Toggler.defaults = {
|
||||||
|
/**
|
||||||
|
* Class of the element to toggle. It can be provided with or without "."
|
||||||
|
* @option
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
toggler: undefined,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tells the plugin if the element should animated when toggled.
|
||||||
|
* @option
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
animate: false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 19:
|
||||||
|
/*!********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.toggler.js ***!
|
||||||
|
\********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.toggler.js */"./js/entries/plugins/foundation.toggler.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.toggler.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,354 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.box"] = factory(require("./foundation.core"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.box"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__) {
|
||||||
|
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 = 21);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.box.js":
|
||||||
|
/*!***************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.box.js ***!
|
||||||
|
\***************************************************/
|
||||||
|
/*! exports provided: Foundation, Box */
|
||||||
|
/***/ (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_util_box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.box */ "./js/foundation.util.box.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return _foundation_util_box__WEBPACK_IMPORTED_MODULE_1__["Box"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].Box = _foundation_util_box__WEBPACK_IMPORTED_MODULE_1__["Box"];
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.box.js":
|
||||||
|
/*!***********************************!*\
|
||||||
|
!*** ./js/foundation.util.box.js ***!
|
||||||
|
\***********************************/
|
||||||
|
/*! exports provided: Box */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return Box; });
|
||||||
|
|
||||||
|
|
||||||
|
var Box = {
|
||||||
|
ImNotTouchingYou: ImNotTouchingYou,
|
||||||
|
OverlapArea: OverlapArea,
|
||||||
|
GetDimensions: GetDimensions,
|
||||||
|
GetExplicitOffsets: GetExplicitOffsets
|
||||||
|
/**
|
||||||
|
* Compares the dimensions of an element to a container and determines collision events with container.
|
||||||
|
* @function
|
||||||
|
* @param {jQuery} element - jQuery object to test for collisions.
|
||||||
|
* @param {jQuery} parent - jQuery object to use as bounding container.
|
||||||
|
* @param {Boolean} lrOnly - set to true to check left and right values only.
|
||||||
|
* @param {Boolean} tbOnly - set to true to check top and bottom values only.
|
||||||
|
* @default if no parent object passed, detects collisions with `window`.
|
||||||
|
* @returns {Boolean} - true if collision free, false if a collision in any direction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {
|
||||||
|
return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {
|
||||||
|
var eleDims = GetDimensions(element),
|
||||||
|
topOver,
|
||||||
|
bottomOver,
|
||||||
|
leftOver,
|
||||||
|
rightOver;
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
var parDims = GetDimensions(parent);
|
||||||
|
bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height);
|
||||||
|
topOver = eleDims.offset.top - parDims.offset.top;
|
||||||
|
leftOver = eleDims.offset.left - parDims.offset.left;
|
||||||
|
rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width);
|
||||||
|
} else {
|
||||||
|
bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height);
|
||||||
|
topOver = eleDims.offset.top - eleDims.windowDims.offset.top;
|
||||||
|
leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;
|
||||||
|
rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);
|
||||||
|
}
|
||||||
|
|
||||||
|
bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);
|
||||||
|
topOver = Math.min(topOver, 0);
|
||||||
|
leftOver = Math.min(leftOver, 0);
|
||||||
|
rightOver = Math.min(rightOver, 0);
|
||||||
|
|
||||||
|
if (lrOnly) {
|
||||||
|
return leftOver + rightOver;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tbOnly) {
|
||||||
|
return topOver + bottomOver;
|
||||||
|
} // use sum of squares b/c we care about overlap area.
|
||||||
|
|
||||||
|
|
||||||
|
return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Uses native methods to return an object of dimension values.
|
||||||
|
* @function
|
||||||
|
* @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.
|
||||||
|
* @returns {Object} - nested object of integer pixel values
|
||||||
|
* TODO - if element is window, return only those values.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function GetDimensions(elem) {
|
||||||
|
elem = elem.length ? elem[0] : elem;
|
||||||
|
|
||||||
|
if (elem === window || elem === document) {
|
||||||
|
throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var rect = elem.getBoundingClientRect(),
|
||||||
|
parRect = elem.parentNode.getBoundingClientRect(),
|
||||||
|
winRect = document.body.getBoundingClientRect(),
|
||||||
|
winY = window.pageYOffset,
|
||||||
|
winX = window.pageXOffset;
|
||||||
|
return {
|
||||||
|
width: rect.width,
|
||||||
|
height: rect.height,
|
||||||
|
offset: {
|
||||||
|
top: rect.top + winY,
|
||||||
|
left: rect.left + winX
|
||||||
|
},
|
||||||
|
parentDims: {
|
||||||
|
width: parRect.width,
|
||||||
|
height: parRect.height,
|
||||||
|
offset: {
|
||||||
|
top: parRect.top + winY,
|
||||||
|
left: parRect.left + winX
|
||||||
|
}
|
||||||
|
},
|
||||||
|
windowDims: {
|
||||||
|
width: winRect.width,
|
||||||
|
height: winRect.height,
|
||||||
|
offset: {
|
||||||
|
top: winY,
|
||||||
|
left: winX
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns an object of top and left integer pixel values for dynamically rendered elements,
|
||||||
|
* such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where
|
||||||
|
* you don't know alignment, but generally from
|
||||||
|
* 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.
|
||||||
|
* @function
|
||||||
|
* @param {jQuery} element - jQuery object for the element being positioned.
|
||||||
|
* @param {jQuery} anchor - jQuery object for the element's anchor point.
|
||||||
|
* @param {String} position - a string relating to the desired position of the element, relative to it's anchor
|
||||||
|
* @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.
|
||||||
|
* @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.
|
||||||
|
* @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.
|
||||||
|
* TODO alter/rewrite to work with `em` values as well/instead of pixels
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {
|
||||||
|
var $eleDims = GetDimensions(element),
|
||||||
|
$anchorDims = anchor ? GetDimensions(anchor) : null;
|
||||||
|
var topVal, leftVal;
|
||||||
|
|
||||||
|
if ($anchorDims !== null) {
|
||||||
|
// set position related attribute
|
||||||
|
switch (position) {
|
||||||
|
case 'top':
|
||||||
|
topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'bottom':
|
||||||
|
topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'left':
|
||||||
|
leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'right':
|
||||||
|
leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;
|
||||||
|
break;
|
||||||
|
} // set alignment related attribute
|
||||||
|
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case 'top':
|
||||||
|
case 'bottom':
|
||||||
|
switch (alignment) {
|
||||||
|
case 'left':
|
||||||
|
leftVal = $anchorDims.offset.left + hOffset;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'right':
|
||||||
|
leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'center':
|
||||||
|
leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'right':
|
||||||
|
case 'left':
|
||||||
|
switch (alignment) {
|
||||||
|
case 'bottom':
|
||||||
|
topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top':
|
||||||
|
topVal = $anchorDims.offset.top + vOffset;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'center':
|
||||||
|
topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
top: topVal,
|
||||||
|
left: leftVal
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 21:
|
||||||
|
/*!*********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.box.js ***!
|
||||||
|
\*********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.box.js */"./js/entries/plugins/foundation.util.box.js");
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
});
|
||||||
|
//# sourceMappingURL=foundation.util.box.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,218 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.imageLoader"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.imageLoader"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 22);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.imageLoader.js":
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.imageLoader.js ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/*! exports provided: Foundation, onImagesLoaded */
|
||||||
|
/***/ (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_util_imageLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_1__["onImagesLoaded"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].onImagesLoaded = _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_1__["onImagesLoaded"];
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.imageLoader.js":
|
||||||
|
/*!*******************************************!*\
|
||||||
|
!*** ./js/foundation.util.imageLoader.js ***!
|
||||||
|
\*******************************************/
|
||||||
|
/*! exports provided: onImagesLoaded */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return onImagesLoaded; });
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs a callback function when images are fully loaded.
|
||||||
|
* @param {Object} images - Image(s) to check if loaded.
|
||||||
|
* @param {Func} callback - Function to execute when image is fully loaded.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function onImagesLoaded(images, callback) {
|
||||||
|
var self = this,
|
||||||
|
unloaded = images.length;
|
||||||
|
|
||||||
|
if (unloaded === 0) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
|
images.each(function () {
|
||||||
|
// Check if image is loaded
|
||||||
|
if (this.complete && typeof this.naturalWidth !== 'undefined') {
|
||||||
|
singleImageLoaded();
|
||||||
|
} else {
|
||||||
|
// If the above check failed, simulate loading on detached element.
|
||||||
|
var image = new Image(); // Still count image as loaded if it finalizes with an error.
|
||||||
|
|
||||||
|
var events = "load.zf.images error.zf.images";
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(image).one(events, function me(event) {
|
||||||
|
// Unbind the event listeners. We're using 'one' but only one of the two events will have fired.
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off(events, me);
|
||||||
|
singleImageLoaded();
|
||||||
|
});
|
||||||
|
image.src = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('src');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function singleImageLoaded() {
|
||||||
|
unloaded--;
|
||||||
|
|
||||||
|
if (unloaded === 0) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 22:
|
||||||
|
/*!*****************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.imageLoader.js ***!
|
||||||
|
\*****************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.imageLoader.js */"./js/entries/plugins/foundation.util.imageLoader.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.util.imageLoader.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,341 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.keyboard"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 23);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.keyboard.js":
|
||||||
|
/*!********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.keyboard.js ***!
|
||||||
|
\********************************************************/
|
||||||
|
/*! exports provided: Foundation, Keyboard */
|
||||||
|
/***/ (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_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].Keyboard = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"];
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.keyboard.js":
|
||||||
|
/*!****************************************!*\
|
||||||
|
!*** ./js/foundation.util.keyboard.js ***!
|
||||||
|
\****************************************/
|
||||||
|
/*! exports provided: Keyboard */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return Keyboard; });
|
||||||
|
/* 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__);
|
||||||
|
/*******************************************
|
||||||
|
* *
|
||||||
|
* This util was created by Marius Olbertz *
|
||||||
|
* Please thank Marius on GitHub /owlbertz *
|
||||||
|
* or the web http://www.mariusolbertz.de/ *
|
||||||
|
* *
|
||||||
|
******************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var keyCodes = {
|
||||||
|
9: 'TAB',
|
||||||
|
13: 'ENTER',
|
||||||
|
27: 'ESCAPE',
|
||||||
|
32: 'SPACE',
|
||||||
|
35: 'END',
|
||||||
|
36: 'HOME',
|
||||||
|
37: 'ARROW_LEFT',
|
||||||
|
38: 'ARROW_UP',
|
||||||
|
39: 'ARROW_RIGHT',
|
||||||
|
40: 'ARROW_DOWN'
|
||||||
|
};
|
||||||
|
var commands = {}; // Functions pulled out to be referenceable from internals
|
||||||
|
|
||||||
|
function findFocusable($element) {
|
||||||
|
if (!$element) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 () {
|
||||||
|
if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) {
|
||||||
|
return false;
|
||||||
|
} //only have visible elements and those that have a tabindex greater or equal 0
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseKey(event) {
|
||||||
|
var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase(); // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events
|
||||||
|
|
||||||
|
key = key.replace(/\W+/, '');
|
||||||
|
if (event.shiftKey) key = "SHIFT_".concat(key);
|
||||||
|
if (event.ctrlKey) key = "CTRL_".concat(key);
|
||||||
|
if (event.altKey) key = "ALT_".concat(key); // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)
|
||||||
|
|
||||||
|
key = key.replace(/_$/, '');
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
var Keyboard = {
|
||||||
|
keys: getKeyCodes(keyCodes),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the (keyboard) event and returns a String that represents its key
|
||||||
|
* Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
|
||||||
|
* @param {Event} event - the event generated by the event handler
|
||||||
|
* @return String key - String that represents the key pressed
|
||||||
|
*/
|
||||||
|
parseKey: parseKey,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the given (keyboard) event
|
||||||
|
* @param {Event} event - the event generated by the event handler
|
||||||
|
* @param {String} component - Foundation component's name, e.g. Slider or Reveal
|
||||||
|
* @param {Objects} functions - collection of functions that are to be executed
|
||||||
|
*/
|
||||||
|
handleKey: function handleKey(event, component, functions) {
|
||||||
|
var commandList = commands[component],
|
||||||
|
keyCode = this.parseKey(event),
|
||||||
|
cmds,
|
||||||
|
command,
|
||||||
|
fn;
|
||||||
|
if (!commandList) return console.warn('Component not defined!'); // Ignore the event if it was already handled
|
||||||
|
|
||||||
|
if (event.zfIsKeyHandled === true) return; // This component does not differentiate between ltr and rtl
|
||||||
|
|
||||||
|
if (typeof commandList.ltr === 'undefined') {
|
||||||
|
cmds = commandList; // use plain list
|
||||||
|
} else {
|
||||||
|
// merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa
|
||||||
|
if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["rtl"])()) cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.ltr, commandList.rtl);else cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.rtl, commandList.ltr);
|
||||||
|
}
|
||||||
|
|
||||||
|
command = cmds[keyCode];
|
||||||
|
fn = functions[command]; // Execute the handler if found
|
||||||
|
|
||||||
|
if (fn && typeof fn === 'function') {
|
||||||
|
var returnValue = fn.apply(); // Mark the event as "handled" to prevent future handlings
|
||||||
|
|
||||||
|
event.zfIsKeyHandled = true; // Execute function when event was handled
|
||||||
|
|
||||||
|
if (functions.handled || typeof functions.handled === 'function') {
|
||||||
|
functions.handled(returnValue);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Execute function when event was not handled
|
||||||
|
if (functions.unhandled || typeof functions.unhandled === 'function') {
|
||||||
|
functions.unhandled();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds all focusable elements within the given `$element`
|
||||||
|
* @param {jQuery} $element - jQuery object to search within
|
||||||
|
* @return {jQuery} $focusable - all focusable elements within `$element`
|
||||||
|
*/
|
||||||
|
findFocusable: findFocusable,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the component name name
|
||||||
|
* @param {Object} component - Foundation component, e.g. Slider or Reveal
|
||||||
|
* @return String componentName
|
||||||
|
*/
|
||||||
|
register: function register(componentName, cmds) {
|
||||||
|
commands[componentName] = cmds;
|
||||||
|
},
|
||||||
|
// TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?
|
||||||
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Traps the focus in the given element.
|
||||||
|
* @param {jQuery} $element jQuery object to trap the foucs into.
|
||||||
|
*/
|
||||||
|
trapFocus: function trapFocus($element) {
|
||||||
|
var $focusable = findFocusable($element),
|
||||||
|
$firstFocusable = $focusable.eq(0),
|
||||||
|
$lastFocusable = $focusable.eq(-1);
|
||||||
|
$element.on('keydown.zf.trapfocus', function (event) {
|
||||||
|
if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {
|
||||||
|
event.preventDefault();
|
||||||
|
$firstFocusable.focus();
|
||||||
|
} else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {
|
||||||
|
event.preventDefault();
|
||||||
|
$lastFocusable.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Releases the trapped focus from the given element.
|
||||||
|
* @param {jQuery} $element jQuery object to release the focus for.
|
||||||
|
*/
|
||||||
|
releaseFocus: function releaseFocus($element) {
|
||||||
|
$element.off('keydown.zf.trapfocus');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
* Constants for easier comparing.
|
||||||
|
* Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getKeyCodes(kcs) {
|
||||||
|
var k = {};
|
||||||
|
|
||||||
|
for (var kc in kcs) {
|
||||||
|
k[kcs[kc]] = kcs[kc];
|
||||||
|
}
|
||||||
|
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 23:
|
||||||
|
/*!**************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.keyboard.js ***!
|
||||||
|
\**************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.keyboard.js */"./js/entries/plugins/foundation.util.keyboard.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.util.keyboard.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,509 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.mediaQuery"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 24);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.mediaQuery.js":
|
||||||
|
/*!**********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.mediaQuery.js ***!
|
||||||
|
\**********************************************************/
|
||||||
|
/*! exports provided: Foundation, MediaQuery */
|
||||||
|
/***/ (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_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].MediaQuery = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"];
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].MediaQuery._init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.mediaQuery.js":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** ./js/foundation.util.mediaQuery.js ***!
|
||||||
|
\******************************************/
|
||||||
|
/*! exports provided: MediaQuery */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; });
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
||||||
|
|
||||||
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
||||||
|
|
||||||
|
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
||||||
|
|
||||||
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||||
|
|
||||||
|
// Default set of media queries
|
||||||
|
|
||||||
|
var defaultQueries = {
|
||||||
|
'default': 'only screen',
|
||||||
|
landscape: 'only screen and (orientation: landscape)',
|
||||||
|
portrait: 'only screen and (orientation: portrait)',
|
||||||
|
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)'
|
||||||
|
}; // matchMedia() polyfill - Test a CSS media type/query in JS.
|
||||||
|
// Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license
|
||||||
|
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
window.matchMedia || (window.matchMedia = function () {
|
||||||
|
"use strict"; // For browsers that support matchMedium api such as IE 9 and webkit
|
||||||
|
|
||||||
|
var styleMedia = window.styleMedia || window.media; // For those that don't support matchMedium
|
||||||
|
|
||||||
|
if (!styleMedia) {
|
||||||
|
var style = document.createElement('style'),
|
||||||
|
script = document.getElementsByTagName('script')[0],
|
||||||
|
info = null;
|
||||||
|
style.type = 'text/css';
|
||||||
|
style.id = 'matchmediajs-test';
|
||||||
|
|
||||||
|
if (!script) {
|
||||||
|
document.head.appendChild(style);
|
||||||
|
} else {
|
||||||
|
script.parentNode.insertBefore(style, script);
|
||||||
|
} // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
||||||
|
|
||||||
|
|
||||||
|
info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;
|
||||||
|
styleMedia = {
|
||||||
|
matchMedium: function matchMedium(media) {
|
||||||
|
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
||||||
|
|
||||||
|
if (style.styleSheet) {
|
||||||
|
style.styleSheet.cssText = text;
|
||||||
|
} else {
|
||||||
|
style.textContent = text;
|
||||||
|
} // Test if media query is true or false
|
||||||
|
|
||||||
|
|
||||||
|
return info.width === '1px';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return function (media) {
|
||||||
|
return {
|
||||||
|
matches: styleMedia.matchMedium(media || 'all'),
|
||||||
|
media: media || 'all'
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}());
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
|
var MediaQuery = {
|
||||||
|
queries: [],
|
||||||
|
current: '',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_init: function _init() {
|
||||||
|
// make sure the initialization is only done once when calling _init() several times
|
||||||
|
if (this.isInitialized === true) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
this.isInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
var $meta = jquery__WEBPACK_IMPORTED_MODULE_0___default()('meta.foundation-mq');
|
||||||
|
|
||||||
|
if (!$meta.length) {
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()('<meta class="foundation-mq">').appendTo(document.head);
|
||||||
|
}
|
||||||
|
|
||||||
|
var extractedStyles = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.foundation-mq').css('font-family');
|
||||||
|
var namedQueries;
|
||||||
|
namedQueries = parseStyleToObject(extractedStyles);
|
||||||
|
self.queries = []; // reset
|
||||||
|
|
||||||
|
for (var key in namedQueries) {
|
||||||
|
if (namedQueries.hasOwnProperty(key)) {
|
||||||
|
self.queries.push({
|
||||||
|
name: key,
|
||||||
|
value: "only screen and (min-width: ".concat(namedQueries[key], ")")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.current = this._getCurrentSize();
|
||||||
|
|
||||||
|
this._watcher();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reinitializes the media query helper.
|
||||||
|
* Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_reInit: function _reInit() {
|
||||||
|
this.isInitialized = false;
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the screen is at least as wide as a breakpoint.
|
||||||
|
* @function
|
||||||
|
* @param {String} size - Name of the breakpoint to check.
|
||||||
|
* @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.
|
||||||
|
*/
|
||||||
|
atLeast: function atLeast(size) {
|
||||||
|
var query = this.get(size);
|
||||||
|
|
||||||
|
if (query) {
|
||||||
|
return window.matchMedia(query).matches;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the screen is within the given breakpoint.
|
||||||
|
* If smaller than the breakpoint of larger than its upper limit it returns false.
|
||||||
|
* @function
|
||||||
|
* @param {String} size - Name of the breakpoint to check.
|
||||||
|
* @returns {Boolean} `true` if the breakpoint matches, `false` otherwise.
|
||||||
|
*/
|
||||||
|
only: function only(size) {
|
||||||
|
return size === this._getCurrentSize();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the screen is within a breakpoint or smaller.
|
||||||
|
* @function
|
||||||
|
* @param {String} size - Name of the breakpoint to check.
|
||||||
|
* @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger.
|
||||||
|
*/
|
||||||
|
upTo: function upTo(size) {
|
||||||
|
var nextSize = this.next(size); // If the next breakpoint does not match, the screen is smaller than
|
||||||
|
// the upper limit of this breakpoint.
|
||||||
|
|
||||||
|
if (nextSize) {
|
||||||
|
return !this.atLeast(nextSize);
|
||||||
|
} // If there is no next breakpoint, the "size" breakpoint does not have
|
||||||
|
// an upper limit and the screen will always be within it or smaller.
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the screen matches to a breakpoint.
|
||||||
|
* @function
|
||||||
|
* @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.
|
||||||
|
* @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.
|
||||||
|
*/
|
||||||
|
is: function is(size) {
|
||||||
|
var parts = size.trim().split(' ').filter(function (p) {
|
||||||
|
return !!p.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
var _parts = _slicedToArray(parts, 2),
|
||||||
|
bpSize = _parts[0],
|
||||||
|
_parts$ = _parts[1],
|
||||||
|
bpModifier = _parts$ === void 0 ? '' : _parts$; // Only the breakpont
|
||||||
|
|
||||||
|
|
||||||
|
if (bpModifier === 'only') {
|
||||||
|
return this.only(bpSize);
|
||||||
|
} // At least the breakpoint (included)
|
||||||
|
|
||||||
|
|
||||||
|
if (!bpModifier || bpModifier === 'up') {
|
||||||
|
return this.atLeast(bpSize);
|
||||||
|
} // Up to the breakpoint (included)
|
||||||
|
|
||||||
|
|
||||||
|
if (bpModifier === 'down') {
|
||||||
|
return this.upTo(bpSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error("\n Invalid breakpoint passed to MediaQuery.is().\n Expected a breakpoint name formatted like \"<size> <modifier>\", got \"".concat(size, "\".\n "));
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the media query of a breakpoint.
|
||||||
|
* @function
|
||||||
|
* @param {String} size - Name of the breakpoint to get.
|
||||||
|
* @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.
|
||||||
|
*/
|
||||||
|
get: function get(size) {
|
||||||
|
for (var i in this.queries) {
|
||||||
|
if (this.queries.hasOwnProperty(i)) {
|
||||||
|
var query = this.queries[i];
|
||||||
|
if (size === query.name) return query.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the breakpoint following the given breakpoint.
|
||||||
|
* @function
|
||||||
|
* @param {String} size - Name of the breakpoint.
|
||||||
|
* @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one.
|
||||||
|
*/
|
||||||
|
next: function next(size) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
var queryIndex = this.queries.findIndex(function (q) {
|
||||||
|
return _this._getQueryName(q) === size;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (queryIndex === -1) {
|
||||||
|
throw new Error("\n Unknown breakpoint \"".concat(size, "\" passed to MediaQuery.next().\n Ensure it is present in your Sass \"$breakpoints\" setting.\n "));
|
||||||
|
}
|
||||||
|
|
||||||
|
var nextQuery = this.queries[queryIndex + 1];
|
||||||
|
return nextQuery ? nextQuery.name : null;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the breakpoint related to the given value.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {String|Object} value - Breakpoint name or query object.
|
||||||
|
* @returns {String} Name of the breakpoint.
|
||||||
|
*/
|
||||||
|
_getQueryName: function _getQueryName(value) {
|
||||||
|
if (typeof value === 'string') return value;
|
||||||
|
if (_typeof(value) === 'object') return value.name;
|
||||||
|
throw new TypeError("\n Invalid value passed to MediaQuery._getQueryName().\n Expected a breakpoint name (String) or a breakpoint query (Object), got \"".concat(value, "\" (").concat(_typeof(value), ")\n "));
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @returns {String} Name of the current breakpoint.
|
||||||
|
*/
|
||||||
|
_getCurrentSize: function _getCurrentSize() {
|
||||||
|
var matched;
|
||||||
|
|
||||||
|
for (var i = 0; i < this.queries.length; i++) {
|
||||||
|
var query = this.queries[i];
|
||||||
|
|
||||||
|
if (window.matchMedia(query.value).matches) {
|
||||||
|
matched = query;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matched && this._getQueryName(matched);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_watcher: function _watcher() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () {
|
||||||
|
var newSize = _this2._getCurrentSize(),
|
||||||
|
currentSize = _this2.current;
|
||||||
|
|
||||||
|
if (newSize !== currentSize) {
|
||||||
|
// Change the current media query
|
||||||
|
_this2.current = newSize; // Broadcast the media query change on the window
|
||||||
|
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}; // Thank you: https://github.com/sindresorhus/query-string
|
||||||
|
|
||||||
|
function parseStyleToObject(str) {
|
||||||
|
var styleObject = {};
|
||||||
|
|
||||||
|
if (typeof str !== 'string') {
|
||||||
|
return styleObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
str = str.trim().slice(1, -1); // browsers re-quote string style values
|
||||||
|
|
||||||
|
if (!str) {
|
||||||
|
return styleObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
styleObject = str.split('&').reduce(function (ret, param) {
|
||||||
|
var parts = param.replace(/\+/g, ' ').split('=');
|
||||||
|
var key = parts[0];
|
||||||
|
var val = parts[1];
|
||||||
|
key = decodeURIComponent(key); // missing `=` should be `null`:
|
||||||
|
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
|
||||||
|
|
||||||
|
val = typeof val === 'undefined' ? null : decodeURIComponent(val);
|
||||||
|
|
||||||
|
if (!ret.hasOwnProperty(key)) {
|
||||||
|
ret[key] = val;
|
||||||
|
} else if (Array.isArray(ret[key])) {
|
||||||
|
ret[key].push(val);
|
||||||
|
} else {
|
||||||
|
ret[key] = [ret[key], val];
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}, {});
|
||||||
|
return styleObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 24:
|
||||||
|
/*!****************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.mediaQuery.js ***!
|
||||||
|
\****************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.mediaQuery.js */"./js/entries/plugins/foundation.util.mediaQuery.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.util.mediaQuery.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,274 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.motion"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 25);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.motion.js":
|
||||||
|
/*!******************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.motion.js ***!
|
||||||
|
\******************************************************/
|
||||||
|
/*! exports provided: Foundation, Motion, Move */
|
||||||
|
/***/ (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_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.motion */ "./js/foundation.util.motion.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Move"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].Motion = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"];
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].Move = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Move"];
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.motion.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./js/foundation.util.motion.js ***!
|
||||||
|
\**************************************/
|
||||||
|
/*! exports provided: Move, Motion */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return Move; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return Motion; });
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Motion module.
|
||||||
|
* @module foundation.motion
|
||||||
|
*/
|
||||||
|
|
||||||
|
var initClasses = ['mui-enter', 'mui-leave'];
|
||||||
|
var activeClasses = ['mui-enter-active', 'mui-leave-active'];
|
||||||
|
var Motion = {
|
||||||
|
animateIn: function animateIn(element, animation, cb) {
|
||||||
|
animate(true, element, animation, cb);
|
||||||
|
},
|
||||||
|
animateOut: function animateOut(element, animation, cb) {
|
||||||
|
animate(false, element, animation, cb);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function Move(duration, elem, fn) {
|
||||||
|
var anim,
|
||||||
|
prog,
|
||||||
|
start = null; // console.log('called');
|
||||||
|
|
||||||
|
if (duration === 0) {
|
||||||
|
fn.apply(elem);
|
||||||
|
elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function move(ts) {
|
||||||
|
if (!start) start = ts; // console.log(start, ts);
|
||||||
|
|
||||||
|
prog = ts - start;
|
||||||
|
fn.apply(elem);
|
||||||
|
|
||||||
|
if (prog < duration) {
|
||||||
|
anim = window.requestAnimationFrame(move, elem);
|
||||||
|
} else {
|
||||||
|
window.cancelAnimationFrame(anim);
|
||||||
|
elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
anim = window.requestAnimationFrame(move);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Animates an element in or out using a CSS transition class.
|
||||||
|
* @function
|
||||||
|
* @private
|
||||||
|
* @param {Boolean} isIn - Defines if the animation is in or out.
|
||||||
|
* @param {Object} element - jQuery or HTML object to animate.
|
||||||
|
* @param {String} animation - CSS class to use.
|
||||||
|
* @param {Function} cb - Callback to run when animation is finished.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function animate(isIn, element, animation, cb) {
|
||||||
|
element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).eq(0);
|
||||||
|
if (!element.length) return;
|
||||||
|
var initClass = isIn ? initClasses[0] : initClasses[1];
|
||||||
|
var activeClass = isIn ? activeClasses[0] : activeClasses[1]; // Set up the animation
|
||||||
|
|
||||||
|
reset();
|
||||||
|
element.addClass(animation).css('transition', 'none');
|
||||||
|
requestAnimationFrame(function () {
|
||||||
|
element.addClass(initClass);
|
||||||
|
if (isIn) element.show();
|
||||||
|
}); // Start the animation
|
||||||
|
|
||||||
|
requestAnimationFrame(function () {
|
||||||
|
// will trigger the browser to synchronously calculate the style and layout
|
||||||
|
// also called reflow or layout thrashing
|
||||||
|
// see https://gist.github.com/paulirish/5d52fb081b3570c81e3a
|
||||||
|
element[0].offsetWidth;
|
||||||
|
element.css('transition', '').addClass(activeClass);
|
||||||
|
}); // Clean up the animation when it finishes
|
||||||
|
|
||||||
|
element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(element), finish); // Hides the element (for out animations), resets the element, and runs a callback
|
||||||
|
|
||||||
|
function finish() {
|
||||||
|
if (!isIn) element.hide();
|
||||||
|
reset();
|
||||||
|
if (cb) cb.apply(element);
|
||||||
|
} // Resets transitions and removes motion-specific classes
|
||||||
|
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
element[0].style.transitionDuration = 0;
|
||||||
|
element.removeClass("".concat(initClass, " ").concat(activeClass, " ").concat(animation));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 25:
|
||||||
|
/*!************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.motion.js ***!
|
||||||
|
\************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.motion.js */"./js/entries/plugins/foundation.util.motion.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.util.motion.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,240 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.nest"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.nest"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 26);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.nest.js":
|
||||||
|
/*!****************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.nest.js ***!
|
||||||
|
\****************************************************/
|
||||||
|
/*! exports provided: Foundation, Nest */
|
||||||
|
/***/ (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_util_nest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.nest */ "./js/foundation.util.nest.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return _foundation_util_nest__WEBPACK_IMPORTED_MODULE_1__["Nest"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].Nest = _foundation_util_nest__WEBPACK_IMPORTED_MODULE_1__["Nest"];
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.nest.js":
|
||||||
|
/*!************************************!*\
|
||||||
|
!*** ./js/foundation.util.nest.js ***!
|
||||||
|
\************************************/
|
||||||
|
/*! exports provided: Nest */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return Nest; });
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var Nest = {
|
||||||
|
Feather: function Feather(menu) {
|
||||||
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf';
|
||||||
|
menu.attr('role', 'menubar');
|
||||||
|
menu.find('a').attr({
|
||||||
|
'role': 'menuitem'
|
||||||
|
});
|
||||||
|
var items = menu.find('li').attr({
|
||||||
|
'role': 'none'
|
||||||
|
}),
|
||||||
|
subMenuClass = "is-".concat(type, "-submenu"),
|
||||||
|
subItemClass = "".concat(subMenuClass, "-item"),
|
||||||
|
hasSubClass = "is-".concat(type, "-submenu-parent"),
|
||||||
|
applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes.
|
||||||
|
|
||||||
|
items.each(function () {
|
||||||
|
var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
||||||
|
$sub = $item.children('ul');
|
||||||
|
|
||||||
|
if ($sub.length) {
|
||||||
|
$item.addClass(hasSubClass);
|
||||||
|
|
||||||
|
if (applyAria) {
|
||||||
|
$item.attr({
|
||||||
|
'aria-haspopup': true,
|
||||||
|
'aria-label': $item.children('a:first').text()
|
||||||
|
}); // Note: Drilldowns behave differently in how they hide, and so need
|
||||||
|
// additional attributes. We should look if this possibly over-generalized
|
||||||
|
// utility (Nest) is appropriate when we rework menus in 6.4
|
||||||
|
|
||||||
|
if (type === 'drilldown') {
|
||||||
|
$item.attr({
|
||||||
|
'aria-expanded': false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sub.addClass("submenu ".concat(subMenuClass)).attr({
|
||||||
|
'data-submenu': '',
|
||||||
|
'role': 'menubar'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (type === 'drilldown') {
|
||||||
|
$sub.attr({
|
||||||
|
'aria-hidden': true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($item.parent('[data-submenu]').length) {
|
||||||
|
$item.addClass("is-submenu-item ".concat(subItemClass));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
},
|
||||||
|
Burn: function Burn(menu, type) {
|
||||||
|
var //items = menu.find('li'),
|
||||||
|
subMenuClass = "is-".concat(type, "-submenu"),
|
||||||
|
subItemClass = "".concat(subMenuClass, "-item"),
|
||||||
|
hasSubClass = "is-".concat(type, "-submenu-parent");
|
||||||
|
menu.find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li').removeClass("".concat(subMenuClass, " ").concat(subItemClass, " ").concat(hasSubClass, " is-submenu-item submenu is-active")).removeAttr('data-submenu').css('display', '');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 26:
|
||||||
|
/*!**********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.nest.js ***!
|
||||||
|
\**********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.nest.js */"./js/entries/plugins/foundation.util.nest.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.util.nest.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,226 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.timer"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.timer"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 27);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.timer.js":
|
||||||
|
/*!*****************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.timer.js ***!
|
||||||
|
\*****************************************************/
|
||||||
|
/*! exports provided: Foundation, Timer */
|
||||||
|
/***/ (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_util_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.timer */ "./js/foundation.util.timer.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _foundation_util_timer__WEBPACK_IMPORTED_MODULE_1__["Timer"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].Timer = _foundation_util_timer__WEBPACK_IMPORTED_MODULE_1__["Timer"];
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.timer.js":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** ./js/foundation.util.timer.js ***!
|
||||||
|
\*************************************/
|
||||||
|
/*! exports provided: Timer */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function Timer(elem, options, cb) {
|
||||||
|
var _this = this,
|
||||||
|
duration = options.duration,
|
||||||
|
//options is an object for easily adding features later.
|
||||||
|
nameSpace = Object.keys(elem.data())[0] || 'timer',
|
||||||
|
remain = -1,
|
||||||
|
start,
|
||||||
|
timer;
|
||||||
|
|
||||||
|
this.isPaused = false;
|
||||||
|
|
||||||
|
this.restart = function () {
|
||||||
|
remain = -1;
|
||||||
|
clearTimeout(timer);
|
||||||
|
this.start();
|
||||||
|
};
|
||||||
|
|
||||||
|
this.start = function () {
|
||||||
|
this.isPaused = false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
|
||||||
|
|
||||||
|
clearTimeout(timer);
|
||||||
|
remain = remain <= 0 ? duration : remain;
|
||||||
|
elem.data('paused', false);
|
||||||
|
start = Date.now();
|
||||||
|
timer = setTimeout(function () {
|
||||||
|
if (options.infinite) {
|
||||||
|
_this.restart(); //rerun the timer.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cb && typeof cb === 'function') {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
}, remain);
|
||||||
|
elem.trigger("timerstart.zf.".concat(nameSpace));
|
||||||
|
};
|
||||||
|
|
||||||
|
this.pause = function () {
|
||||||
|
this.isPaused = true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
|
||||||
|
|
||||||
|
clearTimeout(timer);
|
||||||
|
elem.data('paused', true);
|
||||||
|
var end = Date.now();
|
||||||
|
remain = remain - (end - start);
|
||||||
|
elem.trigger("timerpaused.zf.".concat(nameSpace));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 27:
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.timer.js ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.timer.js */"./js/entries/plugins/foundation.util.timer.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.util.timer.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,365 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.touch"] = factory(require("./foundation.core"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.touch"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __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 = 28);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.touch.js":
|
||||||
|
/*!*****************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.touch.js ***!
|
||||||
|
\*****************************************************/
|
||||||
|
/*! exports provided: Foundation, Touch */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* 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_util_touch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.touch */ "./js/foundation.util.touch.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__["Touch"]; });
|
||||||
|
|
||||||
|
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core */ "./foundation.core");
|
||||||
|
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_2__["Foundation"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
window.Foundation.Touch = _foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__["Touch"];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/foundation.util.touch.js":
|
||||||
|
/*!*************************************!*\
|
||||||
|
!*** ./js/foundation.util.touch.js ***!
|
||||||
|
\*************************************/
|
||||||
|
/*! exports provided: Touch */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; });
|
||||||
|
/* 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__);
|
||||||
|
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; }
|
||||||
|
|
||||||
|
//**************************************************
|
||||||
|
//**Work inspired by multiple jquery swipe plugins**
|
||||||
|
//**Done by Yohai Ararat ***************************
|
||||||
|
//**************************************************
|
||||||
|
|
||||||
|
var Touch = {};
|
||||||
|
var startPosX,
|
||||||
|
startPosY,
|
||||||
|
startTime,
|
||||||
|
elapsedTime,
|
||||||
|
startEvent,
|
||||||
|
isMoving = false,
|
||||||
|
didMoved = false;
|
||||||
|
|
||||||
|
function onTouchEnd(e) {
|
||||||
|
this.removeEventListener('touchmove', onTouchMove);
|
||||||
|
this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a "tap"
|
||||||
|
|
||||||
|
if (!didMoved) {
|
||||||
|
var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
startEvent = null;
|
||||||
|
isMoving = false;
|
||||||
|
didMoved = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTouchMove(e) {
|
||||||
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMoving) {
|
||||||
|
var x = e.touches[0].pageX;
|
||||||
|
var y = e.touches[0].pageY;
|
||||||
|
var dx = startPosX - x;
|
||||||
|
var dy = startPosY - y;
|
||||||
|
var dir;
|
||||||
|
didMoved = true;
|
||||||
|
elapsedTime = new Date().getTime() - startTime;
|
||||||
|
|
||||||
|
if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) {
|
||||||
|
dir = dx > 0 ? 'left' : 'right';
|
||||||
|
} // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
|
||||||
|
// dir = dy > 0 ? 'down' : 'up';
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if (dir) {
|
||||||
|
e.preventDefault();
|
||||||
|
onTouchEnd.apply(this, arguments);
|
||||||
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('swipe', Object.assign({}, e)), dir).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event("swipe".concat(dir), Object.assign({}, e)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTouchStart(e) {
|
||||||
|
if (e.touches.length == 1) {
|
||||||
|
startPosX = e.touches[0].pageX;
|
||||||
|
startPosY = e.touches[0].pageY;
|
||||||
|
startEvent = e;
|
||||||
|
isMoving = true;
|
||||||
|
didMoved = false;
|
||||||
|
startTime = new Date().getTime();
|
||||||
|
this.addEventListener('touchmove', onTouchMove, false);
|
||||||
|
this.addEventListener('touchend', onTouchEnd, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function teardown() {
|
||||||
|
this.removeEventListener('touchstart', onTouchStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
var SpotSwipe =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function () {
|
||||||
|
function SpotSwipe($) {
|
||||||
|
_classCallCheck(this, SpotSwipe);
|
||||||
|
|
||||||
|
this.version = '1.0.0';
|
||||||
|
this.enabled = 'ontouchstart' in document.documentElement;
|
||||||
|
this.preventDefault = false;
|
||||||
|
this.moveThreshold = 75;
|
||||||
|
this.timeThreshold = 200;
|
||||||
|
this.$ = $;
|
||||||
|
|
||||||
|
this._init();
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(SpotSwipe, [{
|
||||||
|
key: "_init",
|
||||||
|
value: function _init() {
|
||||||
|
var $ = this.$;
|
||||||
|
$.event.special.swipe = {
|
||||||
|
setup: init
|
||||||
|
};
|
||||||
|
$.event.special.tap = {
|
||||||
|
setup: init
|
||||||
|
};
|
||||||
|
$.each(['left', 'up', 'down', 'right'], function () {
|
||||||
|
$.event.special["swipe".concat(this)] = {
|
||||||
|
setup: function setup() {
|
||||||
|
$(this).on('swipe', $.noop);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return SpotSwipe;
|
||||||
|
}();
|
||||||
|
/****************************************************
|
||||||
|
* As far as I can tell, both setupSpotSwipe and *
|
||||||
|
* setupTouchHandler should be idempotent, *
|
||||||
|
* because they directly replace functions & *
|
||||||
|
* values, and do not add event handlers directly. *
|
||||||
|
****************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
Touch.setupSpotSwipe = function ($) {
|
||||||
|
$.spotSwipe = new SpotSwipe($);
|
||||||
|
};
|
||||||
|
/****************************************************
|
||||||
|
* Method for adding pseudo drag events to elements *
|
||||||
|
***************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
Touch.setupTouchHandler = function ($) {
|
||||||
|
$.fn.addTouch = function () {
|
||||||
|
this.each(function (i, el) {
|
||||||
|
$(el).bind('touchstart touchmove touchend touchcancel', function (event) {
|
||||||
|
//we pass the original event object because the jQuery event
|
||||||
|
//object is normalized to w3c specs and does not provide the TouchList
|
||||||
|
handleTouch(event);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var handleTouch = function handleTouch(event) {
|
||||||
|
var touches = event.changedTouches,
|
||||||
|
first = touches[0],
|
||||||
|
eventTypes = {
|
||||||
|
touchstart: 'mousedown',
|
||||||
|
touchmove: 'mousemove',
|
||||||
|
touchend: 'mouseup'
|
||||||
|
},
|
||||||
|
type = eventTypes[event.type],
|
||||||
|
simulatedEvent;
|
||||||
|
|
||||||
|
if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {
|
||||||
|
simulatedEvent = new window.MouseEvent(type, {
|
||||||
|
'bubbles': true,
|
||||||
|
'cancelable': true,
|
||||||
|
'screenX': first.screenX,
|
||||||
|
'screenY': first.screenY,
|
||||||
|
'clientX': first.clientX,
|
||||||
|
'clientY': first.clientY
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
simulatedEvent = document.createEvent('MouseEvent');
|
||||||
|
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0
|
||||||
|
/*left*/
|
||||||
|
, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
first.target.dispatchEvent(simulatedEvent);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Touch.init = function ($) {
|
||||||
|
if (typeof $.spotSwipe === 'undefined') {
|
||||||
|
Touch.setupSpotSwipe($);
|
||||||
|
Touch.setupTouchHandler($);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 28:
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.touch.js ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.touch.js */"./js/entries/plugins/foundation.util.touch.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.util.touch.js.map
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,470 @@
|
|||||||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
module.exports = factory(require("./foundation.core"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else if(typeof define === 'function' && define.amd)
|
||||||
|
define(["./foundation.core", "./foundation.util.motion", "jquery"], factory);
|
||||||
|
else if(typeof exports === 'object')
|
||||||
|
exports["foundation.util.triggers"] = factory(require("./foundation.core"), require("./foundation.util.motion"), require("jquery"));
|
||||||
|
else
|
||||||
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.util.triggers"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["jQuery"]);
|
||||||
|
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __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 = 29);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "./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.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__;
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./js/entries/plugins/foundation.util.triggers.js":
|
||||||
|
/*!********************************************************!*\
|
||||||
|
!*** ./js/entries/plugins/foundation.util.triggers.js ***!
|
||||||
|
\********************************************************/
|
||||||
|
/*! exports provided: Foundation, Triggers */
|
||||||
|
/***/ (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 jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ "jquery");
|
||||||
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);
|
||||||
|
/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../foundation.util.triggers */ "./js/foundation.util.triggers.js");
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_2__["Triggers"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_foundation_util_triggers__WEBPACK_IMPORTED_MODULE_2__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_1___default.a, _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 29:
|
||||||
|
/*!**************************************************************!*\
|
||||||
|
!*** multi ./js/entries/plugins/foundation.util.triggers.js ***!
|
||||||
|
\**************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.util.triggers.js */"./js/entries/plugins/foundation.util.triggers.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.util.triggers.js.map
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,74 +1,56 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Pandora</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="https://bootswatch.com/4/solar/bootstrap.css">
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
|
||||||
<script src="https://bootswatch.com/_assets/css/custom.min.css"></script>
|
|
||||||
<style>
|
|
||||||
/* Set height of the grid so .sidenav can be 100% (adjust if needed) */
|
|
||||||
.row.content {height: 1500px}
|
|
||||||
|
|
||||||
/* Set gray background color and 100% height */
|
|
||||||
.sidenav {
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set black background color, white text and some padding */
|
<!doctype html>
|
||||||
footer {
|
<html class="no-js" lang="en">
|
||||||
background-color: #555;
|
<head>
|
||||||
color: white;
|
<meta charset="utf-8" />
|
||||||
padding: 15px;
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
}
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Pandora WebServer with foundation</title>
|
||||||
/* On small screens, set height to 'auto' for sidenav and grid */
|
<link rel="stylesheet" href="assets/css/foundation.css">
|
||||||
@media screen and (max-width: 767px) {
|
|
||||||
.sidenav {
|
|
||||||
height: auto;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
.row.content {height: auto;}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="grid-container">
|
||||||
<div class="row content">
|
<div class="grid-x grid-padding-x">
|
||||||
<div class="col-sm-3 sidenav">
|
<div class="large-12 cell">
|
||||||
<h4>Pandora WebServer</h4>
|
<h1>Welcome to Pandora!</h1>
|
||||||
<ul class="nav nav-pills nav-stacked">
|
|
||||||
<li class="active"><a href="#section1">GitHub</a></li>
|
|
||||||
</ul><br>
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="text" class="form-control" placeholder="Search Blog..">
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button class="btn btn-default" type="button">
|
|
||||||
<span class="glyphicon glyphicon-search"></span>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-9">
|
<div class="grid-x grid-padding-x">
|
||||||
<h2>What the fuck is pandora?</h2>
|
<div class="large-12 cell">
|
||||||
<h5><span class="glyphicon glyphicon-time"></span>Spoiler: its a selfhost thing</h5>
|
<div class="callout">
|
||||||
<p>Pandora is a self hosting web server wich can be used to test and fastly deploy web pages and apps. It is made in Python 3 and is very lightweight.
|
<h3>The modular and self contained webserver!</h3>
|
||||||
</br>
|
<p>This project was built with Python 3 and uses basic library to handle files within the Pandora folder, it can access it through localserver and via localhost too. The example files are made with Foundation and shows a very basic usage of the funcionality, with javascript enabled.</p>
|
||||||
<br>It uses basic python library and executes and listens on a specific port wich can be changed and it even handles a IP if one wishes to deploy and test in a real world situation.
|
<p>Lets take a dive into it.</p>
|
||||||
</br>
|
</div>
|
||||||
</p>
|
|
||||||
<br><br>
|
<div class="grid-x grid-padding-x">
|
||||||
|
<div class="large-12 cell">
|
||||||
|
<h5>How it works?</h5>
|
||||||
|
<!-- Grid Example -->
|
||||||
|
|
||||||
<h4><small>RECENT POSTS</small></h4>
|
<div class="grid-x grid-padding-x">
|
||||||
<hr>
|
<div class="large-12 cell">
|
||||||
<h2>Officially Blogging</h2>
|
<div class="primary callout">
|
||||||
<h5><span class="glyphicon glyphicon-time"></span> Post by John Doe, Sep 24, 2015.</h5>
|
<p><strong>It's a self contained webserver!</strong> So you just need to put it in the main project folder and the code will access all the itens within it, respecting the hierarchy, just like magic!.</p>
|
||||||
<h5><span class="label label-success">Lorem</span></h5><br>
|
</div>
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
</div>
|
||||||
<hr>
|
</div>
|
||||||
|
<div class="grid-x grid-padding-x">
|
||||||
|
<div class="large-12 cell">
|
||||||
|
<div class="primary callout">
|
||||||
|
<p>Very little codebase to follow and run, it means that it's very easy to modify and make it suits your project in any way.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="large-12 cell">
|
||||||
|
<div class="primary callout">
|
||||||
|
<p>And it also means that if you're not primarily a WebDev, the chances that you dont have something like Apache or Nginx and chances are you dont wanna mess around with another toolset in your sistem just to test and deploy a small site for any purpose you want, Pandora came right into this. <strong>So is this is it! Take a look and deploy your projects!</strong><</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<script src="assets/js/vendor.js"></script>
|
||||||
|
<script src="assets/js/foundation.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in new issue