123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968 |
- (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) {
-
- var installedModules = {};
-
- function __webpack_require__(moduleId) {
-
- if(installedModules[moduleId]) {
- return installedModules[moduleId].exports;
- }
-
- var module = installedModules[moduleId] = {
- i: moduleId,
- l: false,
- exports: {}
- };
-
- modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
- module.l = true;
-
- return module.exports;
- }
-
- __webpack_require__.m = modules;
-
- __webpack_require__.c = installedModules;
-
- __webpack_require__.d = function(exports, name, getter) {
- if(!__webpack_require__.o(exports, name)) {
- Object.defineProperty(exports, name, { enumerable: true, get: getter });
- }
- };
-
- __webpack_require__.r = function(exports) {
- if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- }
- Object.defineProperty(exports, '__esModule', { value: true });
- };
-
-
-
-
-
- __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;
- };
-
- __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;
- };
-
- __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-
- __webpack_require__.p = "";
-
- return __webpack_require__(__webpack_require__.s = 3);
- })
- ({
- "./foundation.core":
- (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;
- }),
- "./foundation.util.box":
- (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_box__;
- }),
- "./foundation.util.keyboard":
- (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__;
- }),
- "./foundation.util.nest":
- (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__;
- }),
- "./js/entries/plugins/foundation.drilldown.js":
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./foundation.core");
- var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
- __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });
- var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./js/foundation.drilldown.js");
- __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":
- (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; });
- var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "jquery");
- var jquery__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
- var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./foundation.util.keyboard");
- var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__);
- var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( "./foundation.util.nest");
- var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__);
- var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( "./foundation.core");
- var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__);
- var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( "./foundation.util.box");
- var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4___default = __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); }
- var Drilldown =
- function (_Plugin) {
- _inherits(Drilldown, _Plugin);
- function Drilldown() {
- _classCallCheck(this, Drilldown);
- return _possibleConstructorReturn(this, _getPrototypeOf(Drilldown).apply(this, arguments));
- }
- _createClass(Drilldown, [{
- key: "_setup",
-
- 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';
- 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'
- });
- }
-
- }, {
- 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');
-
- 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();
- }
-
- }, {
- key: "_prepareMenu",
- value: function _prepareMenu() {
- var _this = this;
-
-
- 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');
- }
- 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);
- }
- this.$wrapper = this.$element.parent();
- this.$wrapper.css(this._getMaxDims());
- }
- }, {
- key: "_resize",
- value: function _resize() {
- this.$wrapper.css({
- 'max-width': 'none',
- 'min-height': 'none'
- });
- this.$wrapper.css(this._getMaxDims());
- }
-
- }, {
- 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();
- }
-
-
- _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');
- });
- }
- });
- }
-
- }, {
- 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));
- }
-
- }, {
- 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 () {
-
- if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');
- });
- }
-
- }, {
- 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();
- return !$element.is(_this.$element.find('> li:first-child > a'));
- },
- down: function down() {
- $nextElement.focus();
- return !$element.is(_this.$element.find('> li:last-child > a'));
- },
- close: function close() {
-
- 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')) {
-
- return false;
- } else if (!$element.is(_this.$menuItems)) {
-
- _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)) {
-
- _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();
- }
- }
- });
- });
- }
-
- }, {
- 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
- });
- }
-
- 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');
-
- _this2.$element.trigger('closed.zf.drilldown');
- });
- }
-
- }, {
- 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) {
-
- _this._hide($elem);
- var parentSubMenu = $elem.parent('li').parent('ul').parent('li');
- if (parentSubMenu.length) {
- _this._show(parentSubMenu);
- }
- });
- }
-
- }, {
- 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);
- });
- }
-
- }, {
- 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]);
- }
- }
-
- }, {
- 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]);
- }
- }
-
- }, {
- key: "_showMenu",
- value: function _showMenu($elem, autoFocus) {
- var _this = this;
- 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));
- });
- this.$currentMenu = $elem;
- 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;
- }
- var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]');
- $submenus.each(function (index) {
-
- 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;
-
- 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);
- });
- }
-
- }, {
- 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')
- });
- }
-
- this.$element.trigger('open.zf.drilldown', [$elem]);
- }
-
- }, {
- 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');
- });
-
- $elem.trigger('hide.zf.drilldown', [$elem]);
- }
-
- }, {
- key: "_getMaxDims",
- value: function _getMaxDims() {
- var maxHeight = 0,
- result = {},
- _this = this;
- 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;
- }
-
- }, {
- 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 = {
-
- autoApplyClass: true,
-
- backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
-
- backButtonPosition: 'top',
-
- wrapper: '<div></div>',
-
- parentLink: false,
-
- closeOnClick: false,
-
- autoHeight: false,
-
- animateHeight: false,
-
- scrollTop: false,
-
- scrollTopElement: '',
-
- scrollTopOffset: 0,
-
- animationDuration: 500,
-
- animationEasing: 'swing'
- };
- }),
- 3:
- (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__("./js/entries/plugins/foundation.drilldown.js");
- }),
- "jquery":
- (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
- })
- });
- });
|