1 |
- {"version":3,"sources":["webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/universalModuleDefinition","webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/bootstrap","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.mediaQuery\"],\"amd\":\"./foundation.util.mediaQuery\",\"commonjs\":\"./foundation.util.mediaQuery\",\"commonjs2\":\"./foundation.util.mediaQuery\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.motion\"],\"amd\":\"./foundation.util.motion\",\"commonjs\":\"./foundation.util.motion\",\"commonjs2\":\"./foundation.util.motion\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/entries/plugins/foundation.responsiveToggle.js","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/foundation.responsiveToggle.js","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["Foundation","plugin","ResponsiveToggle","element","options","$element","$","extend","defaults","data","className","_init","_events","MediaQuery","targetID","console","error","$targetMenu","$toggler","find","filter","target","animate","input","split","animationIn","animationOut","_update","_this","_updateMqHandler","bind","window","on","toggleMenu","atLeast","hideFor","show","hide","is","Motion","animateIn","trigger","triggerHandler","animateOut","toggle","off","Plugin"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAG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;AACD;;;;EAvH4BiB,8D;;AA0H/B5C,gBAAgB,CAACM,QAAjB,GAA4B;AAC1B;;;;;;AAMA2B,SAAO,EAAE,QAPiB;;AAS1B;;;;;;AAMAb,SAAO,EAAE;AAfiB,CAA5B;;;;;;;;;;;;;;;;;;;;;;;;ACzIA,oD","file":"foundation.responsiveToggle.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"./foundation.util.mediaQuery\"), require(\"./foundation.util.motion\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.util.mediaQuery\", \"./foundation.util.motion\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.responsiveToggle\"] = factory(require(\"./foundation.core\"), require(\"./foundation.util.mediaQuery\"), require(\"./foundation.util.motion\"), require(\"jquery\"));\n\telse\n\t\troot[\"__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\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__;","import { Foundation } from './foundation.core';\n\nimport { ResponsiveToggle } from '../../foundation.responsiveToggle';\nFoundation.plugin(ResponsiveToggle, 'ResponsiveToggle');\n\nexport { Foundation, ResponsiveToggle };\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Motion } from './foundation.util.motion';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * ResponsiveToggle module.\n * @module foundation.responsiveToggle\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.motion\n */\n\nclass ResponsiveToggle extends Plugin {\n /**\n * Creates a new instance of Tab Bar.\n * @class\n * @name ResponsiveToggle\n * @fires ResponsiveToggle#init\n * @param {jQuery} element - jQuery object to attach tab bar functionality to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.options = $.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);\n this.className = 'ResponsiveToggle'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the tab bar by finding the target element, toggling element, and running update().\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n var targetID = this.$element.data('responsive-toggle');\n if (!targetID) {\n console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');\n }\n\n this.$targetMenu = $(`#${targetID}`);\n this.$toggler = this.$element.find('[data-toggle]').filter(function() {\n var target = $(this).data('toggle');\n return (target === targetID || target === \"\");\n });\n this.options = $.extend({}, this.options, this.$targetMenu.data());\n\n // If they were set, parse the animation classes\n if(this.options.animate) {\n let input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n }\n\n this._update();\n }\n\n /**\n * Adds necessary event handlers for the tab bar to work.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n this._updateMqHandler = this._update.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._updateMqHandler);\n\n this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));\n }\n\n /**\n * Checks the current media query to determine if the tab bar should be visible or hidden.\n * @function\n * @private\n */\n _update() {\n // Mobile\n if (!MediaQuery.atLeast(this.options.hideFor)) {\n this.$element.show();\n this.$targetMenu.hide();\n }\n\n // Desktop\n else {\n this.$element.hide();\n this.$targetMenu.show();\n }\n }\n\n /**\n * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.\n * @function\n * @fires ResponsiveToggle#toggled\n */\n toggleMenu() {\n if (!MediaQuery.atLeast(this.options.hideFor)) {\n /**\n * Fires when the element attached to the tab bar toggles.\n * @event ResponsiveToggle#toggled\n */\n if(this.options.animate) {\n if (this.$targetMenu.is(':hidden')) {\n Motion.animateIn(this.$targetMenu, this.animationIn, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');\n });\n }\n else {\n Motion.animateOut(this.$targetMenu, this.animationOut, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n });\n }\n }\n else {\n this.$targetMenu.toggle(0);\n this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');\n this.$element.trigger('toggled.zf.responsiveToggle');\n }\n }\n };\n\n _destroy() {\n this.$element.off('.zf.responsiveToggle');\n this.$toggler.off('.zf.responsiveToggle');\n\n $(window).off('changed.zf.mediaquery', this._updateMqHandler);\n }\n}\n\nResponsiveToggle.defaults = {\n /**\n * The breakpoint after which the menu is always shown, and the tab bar is hidden.\n * @option\n * @type {string}\n * @default 'medium'\n */\n hideFor: 'medium',\n\n /**\n * To decide if the toggle should be animated or not.\n * @option\n * @type {boolean}\n * @default false\n */\n animate: false\n};\n\nexport { ResponsiveToggle };\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"],"sourceRoot":""}
|