{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/slinky.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Slinky","element","options","arguments","length","undefined","_classCallCheck","this","settings","_objectSpread","_init","resize","speed","theme","title","menu","jQuery","base","children","first","addClass","_transition","prev","wrapInner","header","prepend","back","prop","each","index","label","parent","find","text","append","_addListeners","_jumpToInitial","_this","on","e","_clicked","Date","now","link","currentTarget","attr","indexOf","hasClass","preventDefault","removeClass","next","show","_move","_resize","hide","parentsUntil","active","jump","setTimeout","height","outerHeight","depth","callback","left","Math","round","parseInt","style","css","concat","content","target","animate","to","count","menus","parents","not","_this2","remove","off","transition-duration","contents","unwrap","split","forEach","field","fn","slinky"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IAC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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 = 0);\n","/*\n * Slinky\n * Rather sweet menus\n * @author Ali Zahid \n * @license MIT\n */\n\nclass Slinky {\n // default options\n get options() {\n return {\n resize: true,\n speed: 300,\n theme: 'slinky-theme-default',\n title: false\n }\n }\n\n constructor(element, options = {}) {\n // save settings\n this.settings = {\n ...this.options,\n ...options\n }\n\n // let's go!\n this._init(element)\n }\n\n // setup the DOM just for us\n _init(element) {\n // the two elements of water and moisture\n this.menu = jQuery(element)\n this.base = this.menu.children().first()\n\n const { menu, settings } = this\n\n // set theme\n menu.addClass('slinky-menu').addClass(settings.theme)\n\n // set transition speed\n this._transition(settings.speed)\n\n // add arrows to links with children\n jQuery('a + ul', menu)\n .prev()\n .addClass('next')\n\n // wrap link text with \n // mostly for styling\n jQuery('li > a', menu).wrapInner('')\n\n // create header item\n const header = jQuery('
  • ').addClass('header')\n\n // prepend it to the list\n jQuery('li > ul', menu).prepend(header)\n\n // create back buttons\n const back = jQuery('')\n .prop('href', '#')\n .addClass('back')\n\n // prepend them to the headers\n jQuery('.header', menu).prepend(back)\n\n // do we need to add titles?\n if (settings.title) {\n // loop through each child list\n jQuery('li > ul', menu).each((index, element) => {\n // get the label from the parent link\n const label = jQuery(element)\n .parent()\n .find('a')\n .first()\n .text()\n\n // if it's not empty, create the title\n if (label) {\n const title = jQuery('
    ')\n .addClass('title')\n .text(label)\n\n // append it to the immediate header\n jQuery('> .header', element).append(title)\n }\n })\n }\n\n // add click listeners\n this._addListeners()\n\n // jump to initial active\n this._jumpToInitial()\n }\n\n // click listeners\n _addListeners() {\n const { menu, settings } = this\n\n jQuery('a', menu).on('click', e => {\n // prevent broken/half transitions\n if (this._clicked + settings.speed > Date.now()) {\n return false\n }\n\n // cache click time to check on next click\n this._clicked = Date.now()\n\n // get the link\n const link = jQuery(e.currentTarget)\n\n // prevent default if it's a hash\n // or a Slinky button\n if (\n link.attr('href').indexOf('#') === 0 ||\n link.hasClass('next') ||\n link.hasClass('back')\n ) {\n e.preventDefault()\n }\n\n // time to move\n if (link.hasClass('next')) {\n // one step forward\n\n // remove the current active\n menu.find('.active').removeClass('active')\n\n // set the new active\n link\n .next()\n .show()\n .addClass('active')\n\n // make the chess move\n this._move(1)\n\n // resize the menu if need be\n if (settings.resize) {\n this._resize(link.next())\n }\n } else if (link.hasClass('back')) {\n // and two steps back\n // just one step back, actually\n\n // make the move\n this._move(-1, () => {\n // remove the current active\n menu.find('.active').removeClass('active')\n\n // set the new active\n link\n .parent()\n .parent()\n .hide()\n .parentsUntil(menu, 'ul')\n .first()\n .addClass('active')\n })\n\n // resize the menu if need be\n if (settings.resize) {\n this._resize(\n link\n .parent()\n .parent()\n .parentsUntil(menu, 'ul')\n )\n }\n }\n })\n }\n\n // jump to initial active on init\n _jumpToInitial() {\n const { menu, settings } = this\n\n // get initial active\n const active = menu.find('.active')\n\n if (active.length > 0) {\n // remove initial active\n active.removeClass('active')\n\n // jump without animation\n this.jump(active, false)\n }\n\n // set initial height on the menu\n // to fix the first transition resize bug\n setTimeout(() => menu.height(menu.outerHeight()), settings.speed)\n }\n\n // slide the menu\n _move(depth = 0, callback = () => {}) {\n // don't bother packing if we're not going anywhere\n if (depth === 0) {\n return\n }\n\n const { settings, base } = this\n\n // get current position from the left\n const left = Math.round(parseInt(base.get(0).style.left)) || 0\n\n // set the new position from the left\n base.css('left', `${left - depth * 100}%`)\n\n // callback after the animation\n if (typeof callback === 'function') {\n setTimeout(callback, settings.speed)\n }\n }\n\n // resize the menu\n // to match content height\n _resize(content) {\n const { menu } = this\n\n menu.height(content.outerHeight())\n }\n\n // set the transition speed\n _transition(speed = 300) {\n const { menu, base } = this\n\n menu.css('transition-duration', `${speed}ms`)\n base.css('transition-duration', `${speed}ms`)\n }\n\n // jump to an element\n jump(target, animate = true) {\n if (!target) {\n return\n }\n\n const { menu, settings } = this\n\n const to = jQuery(target)\n\n // get all current active\n const active = menu.find('.active')\n\n // how many moves must we jump?\n let count = 0\n\n // this many\n // until we reach the parent list\n if (active.length > 0) {\n count = active.parentsUntil(menu, 'ul').length\n }\n\n // remove current active\n // hide all lists\n menu\n .find('ul')\n .removeClass('active')\n .hide()\n\n // get parent list\n const menus = to.parentsUntil(menu, 'ul')\n\n // show parent list\n menus.show()\n\n // show target\n to.show().addClass('active')\n\n // set transition speed to 0 if no animation\n if (!animate) {\n this._transition(0)\n }\n\n // make the checkers move\n this._move(menus.length - count)\n\n // resize menu if need be\n if (settings.resize) {\n this._resize(to)\n }\n\n // set transition speed to default after transition\n if (!animate) {\n this._transition(settings.speed)\n }\n }\n\n // go big or go home\n // just go home\n home(animate = true) {\n const { base, menu, settings } = this\n\n // set transition speed to 0 if no animation\n if (!animate) {\n this._transition(0)\n }\n\n // get current active\n const active = menu.find('.active')\n\n // get all parent lists\n const parents = active.parentsUntil(menu, 'ul')\n\n // make the move\n this._move(-parents.length, () => {\n // remove the current active\n active.removeClass('active').hide()\n\n // hide all parents except base\n parents.not(base).hide()\n })\n\n // resize if need be\n if (settings.resize) {\n this._resize(base)\n }\n\n // set transition speed back to default\n if (animate === false) {\n this._transition(settings.speed)\n }\n }\n\n // crush, kill, destroy\n destroy() {\n const { base, menu } = this\n\n // remove all headers\n jQuery('.header', menu).remove()\n\n // remove Slinky links\n // and click listeners\n jQuery('a', menu)\n .removeClass('next')\n .off('click')\n\n // remove inline styles\n menu.css({\n height: '',\n 'transition-duration': ''\n })\n\n base.css({\n left: '',\n 'transition-duration': ''\n })\n\n // remove Slinky HTML\n jQuery('li > a > span', menu)\n .contents()\n .unwrap()\n\n // remove any current active\n menu.find('.active').removeClass('active')\n\n // remove any Slinky style classes\n const styles = menu.attr('class').split(' ')\n\n styles.forEach(style => {\n if (style.indexOf('slinky') === 0) {\n menu.removeClass(style)\n }\n })\n\n // reset fields\n const fields = ['settings', 'menu', 'base']\n\n fields.forEach(field => delete this[field])\n }\n}\n\n// jQuery plugin\n;($ => {\n $.fn.slinky = function(options) {\n const menu = new Slinky(this, options)\n\n return menu\n }\n})(jQuery)\n"],"sourceRoot":""}