foundation-rails 6.4.1.0 → 6.4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Rakefile +5 -6
- data/lib/foundation/rails/version.rb +1 -1
- data/vendor/assets/js/foundation.abide.js +781 -0
- data/vendor/assets/js/foundation.accordion.js +511 -0
- data/vendor/assets/js/foundation.accordionMenu.js +527 -0
- data/vendor/assets/js/foundation.core.js +860 -0
- data/vendor/assets/js/foundation.drilldown.js +759 -0
- data/vendor/assets/js/foundation.dropdown.js +1131 -0
- data/vendor/assets/js/foundation.dropdownMenu.js +678 -0
- data/vendor/assets/js/foundation.equalizer.js +542 -0
- data/vendor/assets/js/foundation.interchange.js +399 -0
- data/vendor/assets/js/{foundation.js.es6 → foundation.js} +11 -12
- data/vendor/assets/js/foundation.magellan.js +449 -0
- data/vendor/assets/js/foundation.offcanvas.js +1052 -0
- data/vendor/assets/js/foundation.orbit.js +767 -0
- data/vendor/assets/js/foundation.responsiveAccordionTabs.js +440 -0
- data/vendor/assets/js/foundation.responsiveMenu.js +362 -0
- data/vendor/assets/js/foundation.responsiveToggle.js +336 -0
- data/vendor/assets/js/foundation.reveal.js +1066 -0
- data/vendor/assets/js/foundation.slider.js +1236 -0
- data/vendor/assets/js/foundation.smoothScroll.js +303 -0
- data/vendor/assets/js/foundation.sticky.js +1001 -0
- data/vendor/assets/js/foundation.tabs.js +678 -0
- data/vendor/assets/js/foundation.toggler.js +602 -0
- data/vendor/assets/js/foundation.tooltip.js +1195 -0
- data/vendor/assets/js/{foundation.util.box.js.es6 → foundation.util.box.js} +154 -41
- data/vendor/assets/js/foundation.util.imageLoader.js +163 -0
- data/vendor/assets/js/foundation.util.keyboard.js +298 -0
- data/vendor/assets/js/foundation.util.mediaQuery.js +353 -0
- data/vendor/assets/js/foundation.util.motion.js +231 -0
- data/vendor/assets/js/foundation.util.nest.js +181 -0
- data/vendor/assets/js/foundation.util.timer.js +170 -0
- data/vendor/assets/js/foundation.util.timerAndImageLoader.js +90 -0
- data/vendor/assets/js/foundation.util.touch.js +275 -0
- data/vendor/assets/js/foundation.util.triggers.js +399 -0
- data/vendor/assets/js/foundation.zf.responsiveAccordionTabs.js +262 -0
- metadata +37 -71
- data/vendor/assets/js/entries/foundation-plugins.js +0 -25
- data/vendor/assets/js/entries/foundation.js +0 -101
- data/vendor/assets/js/entries/plugins/foundation.abide.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.accordion.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.accordionMenu.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.core.js +0 -21
- data/vendor/assets/js/entries/plugins/foundation.drilldown.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.dropdown.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.dropdownMenu.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.equalizer.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.interchange.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.magellan.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.offcanvas.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.orbit.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.responsiveAccordionTabs.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.responsiveMenu.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.responsiveToggle.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.reveal.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.slider.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.smoothScroll.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.sticky.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.tabs.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.toggler.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.tooltip.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.util.box.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.util.imageLoader.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.util.keyboard.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.util.mediaQuery.js +0 -4
- data/vendor/assets/js/entries/plugins/foundation.util.motion.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.util.nest.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.util.timer.js +0 -5
- data/vendor/assets/js/entries/plugins/foundation.util.touch.js +0 -7
- data/vendor/assets/js/entries/plugins/foundation.util.triggers.js +0 -5
- data/vendor/assets/js/foundation.abide.js.es6 +0 -587
- data/vendor/assets/js/foundation.accordion.js.es6 +0 -329
- data/vendor/assets/js/foundation.accordionMenu.js.es6 +0 -328
- data/vendor/assets/js/foundation.core.js.es6 +0 -337
- data/vendor/assets/js/foundation.drilldown.js.es6 +0 -536
- data/vendor/assets/js/foundation.dropdown.js.es6 +0 -394
- data/vendor/assets/js/foundation.dropdownMenu.js.es6 +0 -458
- data/vendor/assets/js/foundation.equalizer.js.es6 +0 -318
- data/vendor/assets/js/foundation.interchange.js.es6 +0 -210
- data/vendor/assets/js/foundation.magellan.js.es6 +0 -257
- data/vendor/assets/js/foundation.offcanvas.js.es6 +0 -546
- data/vendor/assets/js/foundation.orbit.js.es6 +0 -531
- data/vendor/assets/js/foundation.plugin.js.es6 +0 -54
- data/vendor/assets/js/foundation.positionable.js.es6 +0 -206
- data/vendor/assets/js/foundation.responsiveAccordionTabs.js.es6 +0 -243
- data/vendor/assets/js/foundation.responsiveMenu.js.es6 +0 -155
- data/vendor/assets/js/foundation.responsiveToggle.js.es6 +0 -156
- data/vendor/assets/js/foundation.reveal.js.es6 +0 -585
- data/vendor/assets/js/foundation.slider.js.es6 +0 -712
- data/vendor/assets/js/foundation.smoothScroll.js.es6 +0 -135
- data/vendor/assets/js/foundation.sticky.js.es6 +0 -507
- data/vendor/assets/js/foundation.tabs.js.es6 +0 -498
- data/vendor/assets/js/foundation.toggler.js.es6 +0 -150
- data/vendor/assets/js/foundation.tooltip.js.es6 +0 -462
- data/vendor/assets/js/foundation.util.core.js.es6 +0 -52
- data/vendor/assets/js/foundation.util.imageLoader.js.es6 +0 -45
- data/vendor/assets/js/foundation.util.keyboard.js.es6 +0 -162
- data/vendor/assets/js/foundation.util.mediaQuery.js.es6 +0 -234
- data/vendor/assets/js/foundation.util.motion.js.es6 +0 -104
- data/vendor/assets/js/foundation.util.nest.js.es6 +0 -67
- data/vendor/assets/js/foundation.util.timer.js.es6 +0 -48
- data/vendor/assets/js/foundation.util.touch.js.es6 +0 -149
- data/vendor/assets/js/foundation.util.triggers.js.es6 +0 -268
@@ -0,0 +1,759 @@
|
|
1
|
+
/******/ (function(modules) { // webpackBootstrap
|
2
|
+
/******/ // The module cache
|
3
|
+
/******/ var installedModules = {};
|
4
|
+
/******/
|
5
|
+
/******/ // The require function
|
6
|
+
/******/ function __webpack_require__(moduleId) {
|
7
|
+
/******/
|
8
|
+
/******/ // Check if module is in cache
|
9
|
+
/******/ if(installedModules[moduleId]) {
|
10
|
+
/******/ return installedModules[moduleId].exports;
|
11
|
+
/******/ }
|
12
|
+
/******/ // Create a new module (and put it into the cache)
|
13
|
+
/******/ var module = installedModules[moduleId] = {
|
14
|
+
/******/ i: moduleId,
|
15
|
+
/******/ l: false,
|
16
|
+
/******/ exports: {}
|
17
|
+
/******/ };
|
18
|
+
/******/
|
19
|
+
/******/ // Execute the module function
|
20
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21
|
+
/******/
|
22
|
+
/******/ // Flag the module as loaded
|
23
|
+
/******/ module.l = true;
|
24
|
+
/******/
|
25
|
+
/******/ // Return the exports of the module
|
26
|
+
/******/ return module.exports;
|
27
|
+
/******/ }
|
28
|
+
/******/
|
29
|
+
/******/
|
30
|
+
/******/ // expose the modules object (__webpack_modules__)
|
31
|
+
/******/ __webpack_require__.m = modules;
|
32
|
+
/******/
|
33
|
+
/******/ // expose the module cache
|
34
|
+
/******/ __webpack_require__.c = installedModules;
|
35
|
+
/******/
|
36
|
+
/******/ // identity function for calling harmony imports with the correct context
|
37
|
+
/******/ __webpack_require__.i = function(value) { return value; };
|
38
|
+
/******/
|
39
|
+
/******/ // define getter function for harmony exports
|
40
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
41
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
42
|
+
/******/ Object.defineProperty(exports, name, {
|
43
|
+
/******/ configurable: false,
|
44
|
+
/******/ enumerable: true,
|
45
|
+
/******/ get: getter
|
46
|
+
/******/ });
|
47
|
+
/******/ }
|
48
|
+
/******/ };
|
49
|
+
/******/
|
50
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
51
|
+
/******/ __webpack_require__.n = function(module) {
|
52
|
+
/******/ var getter = module && module.__esModule ?
|
53
|
+
/******/ function getDefault() { return module['default']; } :
|
54
|
+
/******/ function getModuleExports() { return module; };
|
55
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
56
|
+
/******/ return getter;
|
57
|
+
/******/ };
|
58
|
+
/******/
|
59
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
60
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
61
|
+
/******/
|
62
|
+
/******/ // __webpack_public_path__
|
63
|
+
/******/ __webpack_require__.p = "";
|
64
|
+
/******/
|
65
|
+
/******/ // Load entry module and return exports
|
66
|
+
/******/ return __webpack_require__(__webpack_require__.s = 82);
|
67
|
+
/******/ })
|
68
|
+
/************************************************************************/
|
69
|
+
/******/ ({
|
70
|
+
|
71
|
+
/***/ 0:
|
72
|
+
/***/ (function(module, exports) {
|
73
|
+
|
74
|
+
module.exports = jQuery;
|
75
|
+
|
76
|
+
/***/ }),
|
77
|
+
|
78
|
+
/***/ 1:
|
79
|
+
/***/ (function(module, exports) {
|
80
|
+
|
81
|
+
module.exports = {Foundation: window.Foundation};
|
82
|
+
|
83
|
+
/***/ }),
|
84
|
+
|
85
|
+
/***/ 16:
|
86
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
87
|
+
|
88
|
+
"use strict";
|
89
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
90
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
91
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
92
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_drilldown__ = __webpack_require__(46);
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_drilldown__["a" /* Drilldown */], 'Drilldown');
|
97
|
+
|
98
|
+
/***/ }),
|
99
|
+
|
100
|
+
/***/ 2:
|
101
|
+
/***/ (function(module, exports) {
|
102
|
+
|
103
|
+
module.exports = {Plugin: window.Foundation.Plugin};
|
104
|
+
|
105
|
+
/***/ }),
|
106
|
+
|
107
|
+
/***/ 3:
|
108
|
+
/***/ (function(module, exports) {
|
109
|
+
|
110
|
+
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
111
|
+
|
112
|
+
/***/ }),
|
113
|
+
|
114
|
+
/***/ 46:
|
115
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
116
|
+
|
117
|
+
"use strict";
|
118
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Drilldown; });
|
119
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
120
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
121
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
122
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
123
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9);
|
124
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__);
|
125
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(3);
|
126
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__);
|
127
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_box__ = __webpack_require__(8);
|
128
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_box___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_util_box__);
|
129
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin__ = __webpack_require__(2);
|
130
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__);
|
131
|
+
|
132
|
+
|
133
|
+
var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
134
|
+
|
135
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
136
|
+
|
137
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
138
|
+
|
139
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
/**
|
149
|
+
* Drilldown module.
|
150
|
+
* @module foundation.drilldown
|
151
|
+
* @requires foundation.util.keyboard
|
152
|
+
* @requires foundation.util.nest
|
153
|
+
* @requires foundation.util.box
|
154
|
+
*/
|
155
|
+
|
156
|
+
var Drilldown = function (_Plugin) {
|
157
|
+
_inherits(Drilldown, _Plugin);
|
158
|
+
|
159
|
+
function Drilldown() {
|
160
|
+
_classCallCheck(this, Drilldown);
|
161
|
+
|
162
|
+
return _possibleConstructorReturn(this, (Drilldown.__proto__ || Object.getPrototypeOf(Drilldown)).apply(this, arguments));
|
163
|
+
}
|
164
|
+
|
165
|
+
_createClass(Drilldown, [{
|
166
|
+
key: '_setup',
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Creates a new instance of a drilldown menu.
|
170
|
+
* @class
|
171
|
+
* @name Drilldown
|
172
|
+
* @param {jQuery} element - jQuery object to make into an accordion menu.
|
173
|
+
* @param {Object} options - Overrides to the default plugin settings.
|
174
|
+
*/
|
175
|
+
value: function _setup(element, options) {
|
176
|
+
this.$element = element;
|
177
|
+
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Drilldown.defaults, this.$element.data(), options);
|
178
|
+
this.className = 'Drilldown'; // ie9 back compat
|
179
|
+
|
180
|
+
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Feather(this.$element, 'drilldown');
|
181
|
+
|
182
|
+
this._init();
|
183
|
+
|
184
|
+
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Drilldown', {
|
185
|
+
'ENTER': 'open',
|
186
|
+
'SPACE': 'open',
|
187
|
+
'ARROW_RIGHT': 'next',
|
188
|
+
'ARROW_UP': 'up',
|
189
|
+
'ARROW_DOWN': 'down',
|
190
|
+
'ARROW_LEFT': 'previous',
|
191
|
+
'ESCAPE': 'close',
|
192
|
+
'TAB': 'down',
|
193
|
+
'SHIFT_TAB': 'up'
|
194
|
+
});
|
195
|
+
}
|
196
|
+
|
197
|
+
/**
|
198
|
+
* Initializes the drilldown by creating jQuery collections of elements
|
199
|
+
* @private
|
200
|
+
*/
|
201
|
+
|
202
|
+
}, {
|
203
|
+
key: '_init',
|
204
|
+
value: function _init() {
|
205
|
+
if (this.options.autoApplyClass) {
|
206
|
+
this.$element.addClass('drilldown');
|
207
|
+
}
|
208
|
+
|
209
|
+
this.$element.attr({
|
210
|
+
'role': 'tree',
|
211
|
+
'aria-multiselectable': false
|
212
|
+
});
|
213
|
+
this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
|
214
|
+
this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
|
215
|
+
this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a');
|
216
|
+
this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'drilldown'));
|
217
|
+
|
218
|
+
this._prepareMenu();
|
219
|
+
this._registerEvents();
|
220
|
+
|
221
|
+
this._keyboardEvents();
|
222
|
+
}
|
223
|
+
|
224
|
+
/**
|
225
|
+
* prepares drilldown menu by setting attributes to links and elements
|
226
|
+
* sets a min height to prevent content jumping
|
227
|
+
* wraps the element if not already wrapped
|
228
|
+
* @private
|
229
|
+
* @function
|
230
|
+
*/
|
231
|
+
|
232
|
+
}, {
|
233
|
+
key: '_prepareMenu',
|
234
|
+
value: function _prepareMenu() {
|
235
|
+
var _this = this;
|
236
|
+
// if(!this.options.holdOpen){
|
237
|
+
// this._menuLinkEvents();
|
238
|
+
// }
|
239
|
+
this.$submenuAnchors.each(function () {
|
240
|
+
var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
241
|
+
var $sub = $link.parent();
|
242
|
+
if (_this.options.parentLink) {
|
243
|
+
$link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menu-item"></li>');
|
244
|
+
}
|
245
|
+
$link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);
|
246
|
+
$link.children('[data-submenu]').attr({
|
247
|
+
'aria-hidden': true,
|
248
|
+
'tabindex': 0,
|
249
|
+
'role': 'group'
|
250
|
+
});
|
251
|
+
_this._events($link);
|
252
|
+
});
|
253
|
+
this.$submenus.each(function () {
|
254
|
+
var $menu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
255
|
+
$back = $menu.find('.js-drilldown-back');
|
256
|
+
if (!$back.length) {
|
257
|
+
switch (_this.options.backButtonPosition) {
|
258
|
+
case "bottom":
|
259
|
+
$menu.append(_this.options.backButton);
|
260
|
+
break;
|
261
|
+
case "top":
|
262
|
+
$menu.prepend(_this.options.backButton);
|
263
|
+
break;
|
264
|
+
default:
|
265
|
+
console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'");
|
266
|
+
}
|
267
|
+
}
|
268
|
+
_this._back($menu);
|
269
|
+
});
|
270
|
+
|
271
|
+
this.$submenus.addClass('invisible');
|
272
|
+
if (!this.options.autoHeight) {
|
273
|
+
this.$submenus.addClass('drilldown-submenu-cover-previous');
|
274
|
+
}
|
275
|
+
|
276
|
+
// create a wrapper on element if it doesn't exist.
|
277
|
+
if (!this.$element.parent().hasClass('is-drilldown')) {
|
278
|
+
this.$wrapper = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.wrapper).addClass('is-drilldown');
|
279
|
+
if (this.options.animateHeight) this.$wrapper.addClass('animate-height');
|
280
|
+
this.$element.wrap(this.$wrapper);
|
281
|
+
}
|
282
|
+
// set wrapper
|
283
|
+
this.$wrapper = this.$element.parent();
|
284
|
+
this.$wrapper.css(this._getMaxDims());
|
285
|
+
}
|
286
|
+
}, {
|
287
|
+
key: '_resize',
|
288
|
+
value: function _resize() {
|
289
|
+
this.$wrapper.css({ 'max-width': 'none', 'min-height': 'none' });
|
290
|
+
// _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths
|
291
|
+
this.$wrapper.css(this._getMaxDims());
|
292
|
+
}
|
293
|
+
|
294
|
+
/**
|
295
|
+
* Adds event handlers to elements in the menu.
|
296
|
+
* @function
|
297
|
+
* @private
|
298
|
+
* @param {jQuery} $elem - the current menu item to add handlers to.
|
299
|
+
*/
|
300
|
+
|
301
|
+
}, {
|
302
|
+
key: '_events',
|
303
|
+
value: function _events($elem) {
|
304
|
+
var _this = this;
|
305
|
+
|
306
|
+
$elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
|
307
|
+
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) {
|
308
|
+
e.stopImmediatePropagation();
|
309
|
+
e.preventDefault();
|
310
|
+
}
|
311
|
+
|
312
|
+
// if(e.target !== e.currentTarget.firstElementChild){
|
313
|
+
// return false;
|
314
|
+
// }
|
315
|
+
_this._show($elem.parent('li'));
|
316
|
+
|
317
|
+
if (_this.options.closeOnClick) {
|
318
|
+
var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body');
|
319
|
+
$body.off('.zf.drilldown').on('click.zf.drilldown', function (e) {
|
320
|
+
if (e.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(_this.$element[0], e.target)) {
|
321
|
+
return;
|
322
|
+
}
|
323
|
+
e.preventDefault();
|
324
|
+
_this._hideAll();
|
325
|
+
$body.off('.zf.drilldown');
|
326
|
+
});
|
327
|
+
}
|
328
|
+
});
|
329
|
+
}
|
330
|
+
|
331
|
+
/**
|
332
|
+
* Adds event handlers to the menu element.
|
333
|
+
* @function
|
334
|
+
* @private
|
335
|
+
*/
|
336
|
+
|
337
|
+
}, {
|
338
|
+
key: '_registerEvents',
|
339
|
+
value: function _registerEvents() {
|
340
|
+
if (this.options.scrollTop) {
|
341
|
+
this._bindHandler = this._scrollTop.bind(this);
|
342
|
+
this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown', this._bindHandler);
|
343
|
+
}
|
344
|
+
this.$element.on('mutateme.zf.trigger', this._resize.bind(this));
|
345
|
+
}
|
346
|
+
|
347
|
+
/**
|
348
|
+
* Scroll to Top of Element or data-scroll-top-element
|
349
|
+
* @function
|
350
|
+
* @fires Drilldown#scrollme
|
351
|
+
*/
|
352
|
+
|
353
|
+
}, {
|
354
|
+
key: '_scrollTop',
|
355
|
+
value: function _scrollTop() {
|
356
|
+
var _this = this;
|
357
|
+
var $scrollTopElement = _this.options.scrollTopElement != '' ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()(_this.options.scrollTopElement) : _this.$element,
|
358
|
+
scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10);
|
359
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').stop(true).animate({ scrollTop: scrollPos }, _this.options.animationDuration, _this.options.animationEasing, function () {
|
360
|
+
/**
|
361
|
+
* Fires after the menu has scrolled
|
362
|
+
* @event Drilldown#scrollme
|
363
|
+
*/
|
364
|
+
if (this === __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');
|
365
|
+
});
|
366
|
+
}
|
367
|
+
|
368
|
+
/**
|
369
|
+
* Adds keydown event listener to `li`'s in the menu.
|
370
|
+
* @private
|
371
|
+
*/
|
372
|
+
|
373
|
+
}, {
|
374
|
+
key: '_keyboardEvents',
|
375
|
+
value: function _keyboardEvents() {
|
376
|
+
var _this = this;
|
377
|
+
|
378
|
+
this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) {
|
379
|
+
var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
380
|
+
$elements = $element.parent('li').parent('ul').children('li').children('a'),
|
381
|
+
$prevElement,
|
382
|
+
$nextElement;
|
383
|
+
|
384
|
+
$elements.each(function (i) {
|
385
|
+
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) {
|
386
|
+
$prevElement = $elements.eq(Math.max(0, i - 1));
|
387
|
+
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
|
388
|
+
return;
|
389
|
+
}
|
390
|
+
});
|
391
|
+
|
392
|
+
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Drilldown', {
|
393
|
+
next: function () {
|
394
|
+
if ($element.is(_this.$submenuAnchors)) {
|
395
|
+
_this._show($element.parent('li'));
|
396
|
+
$element.parent('li').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
397
|
+
$element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
|
398
|
+
});
|
399
|
+
return true;
|
400
|
+
}
|
401
|
+
},
|
402
|
+
previous: function () {
|
403
|
+
_this._hide($element.parent('li').parent('ul'));
|
404
|
+
$element.parent('li').parent('ul').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
405
|
+
setTimeout(function () {
|
406
|
+
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
|
407
|
+
}, 1);
|
408
|
+
});
|
409
|
+
return true;
|
410
|
+
},
|
411
|
+
up: function () {
|
412
|
+
$prevElement.focus();
|
413
|
+
// Don't tap focus on first element in root ul
|
414
|
+
return !$element.is(_this.$element.find('> li:first-child > a'));
|
415
|
+
},
|
416
|
+
down: function () {
|
417
|
+
$nextElement.focus();
|
418
|
+
// Don't tap focus on last element in root ul
|
419
|
+
return !$element.is(_this.$element.find('> li:last-child > a'));
|
420
|
+
},
|
421
|
+
close: function () {
|
422
|
+
// Don't close on element in root ul
|
423
|
+
if (!$element.is(_this.$element.find('> li > a'))) {
|
424
|
+
_this._hide($element.parent().parent());
|
425
|
+
$element.parent().parent().siblings('a').focus();
|
426
|
+
}
|
427
|
+
},
|
428
|
+
open: function () {
|
429
|
+
if (!$element.is(_this.$menuItems)) {
|
430
|
+
// not menu item means back button
|
431
|
+
_this._hide($element.parent('li').parent('ul'));
|
432
|
+
$element.parent('li').parent('ul').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
433
|
+
setTimeout(function () {
|
434
|
+
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
|
435
|
+
}, 1);
|
436
|
+
});
|
437
|
+
return true;
|
438
|
+
} else if ($element.is(_this.$submenuAnchors)) {
|
439
|
+
_this._show($element.parent('li'));
|
440
|
+
$element.parent('li').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
441
|
+
$element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
|
442
|
+
});
|
443
|
+
return true;
|
444
|
+
}
|
445
|
+
},
|
446
|
+
handled: function (preventDefault) {
|
447
|
+
if (preventDefault) {
|
448
|
+
e.preventDefault();
|
449
|
+
}
|
450
|
+
e.stopImmediatePropagation();
|
451
|
+
}
|
452
|
+
});
|
453
|
+
}); // end keyboardAccess
|
454
|
+
}
|
455
|
+
|
456
|
+
/**
|
457
|
+
* Closes all open elements, and returns to root menu.
|
458
|
+
* @function
|
459
|
+
* @fires Drilldown#closed
|
460
|
+
*/
|
461
|
+
|
462
|
+
}, {
|
463
|
+
key: '_hideAll',
|
464
|
+
value: function _hideAll() {
|
465
|
+
var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing');
|
466
|
+
if (this.options.autoHeight) this.$wrapper.css({ height: $elem.parent().closest('ul').data('calcHeight') });
|
467
|
+
$elem.one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($elem), function (e) {
|
468
|
+
$elem.removeClass('is-active is-closing');
|
469
|
+
});
|
470
|
+
/**
|
471
|
+
* Fires when the menu is fully closed.
|
472
|
+
* @event Drilldown#closed
|
473
|
+
*/
|
474
|
+
this.$element.trigger('closed.zf.drilldown');
|
475
|
+
}
|
476
|
+
|
477
|
+
/**
|
478
|
+
* Adds event listener for each `back` button, and closes open menus.
|
479
|
+
* @function
|
480
|
+
* @fires Drilldown#back
|
481
|
+
* @param {jQuery} $elem - the current sub-menu to add `back` event.
|
482
|
+
*/
|
483
|
+
|
484
|
+
}, {
|
485
|
+
key: '_back',
|
486
|
+
value: function _back($elem) {
|
487
|
+
var _this = this;
|
488
|
+
$elem.off('click.zf.drilldown');
|
489
|
+
$elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) {
|
490
|
+
e.stopImmediatePropagation();
|
491
|
+
// console.log('mouseup on back');
|
492
|
+
_this._hide($elem);
|
493
|
+
|
494
|
+
// If there is a parent submenu, call show
|
495
|
+
var parentSubMenu = $elem.parent('li').parent('ul').parent('li');
|
496
|
+
if (parentSubMenu.length) {
|
497
|
+
_this._show(parentSubMenu);
|
498
|
+
}
|
499
|
+
});
|
500
|
+
}
|
501
|
+
|
502
|
+
/**
|
503
|
+
* Adds event listener to menu items w/o submenus to close open menus on click.
|
504
|
+
* @function
|
505
|
+
* @private
|
506
|
+
*/
|
507
|
+
|
508
|
+
}, {
|
509
|
+
key: '_menuLinkEvents',
|
510
|
+
value: function _menuLinkEvents() {
|
511
|
+
var _this = this;
|
512
|
+
this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
|
513
|
+
// e.stopImmediatePropagation();
|
514
|
+
setTimeout(function () {
|
515
|
+
_this._hideAll();
|
516
|
+
}, 0);
|
517
|
+
});
|
518
|
+
}
|
519
|
+
|
520
|
+
/**
|
521
|
+
* Opens a submenu.
|
522
|
+
* @function
|
523
|
+
* @fires Drilldown#open
|
524
|
+
* @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.
|
525
|
+
*/
|
526
|
+
|
527
|
+
}, {
|
528
|
+
key: '_show',
|
529
|
+
value: function _show($elem) {
|
530
|
+
if (this.options.autoHeight) this.$wrapper.css({ height: $elem.children('[data-submenu]').data('calcHeight') });
|
531
|
+
$elem.attr('aria-expanded', true);
|
532
|
+
$elem.children('[data-submenu]').addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
|
533
|
+
/**
|
534
|
+
* Fires when the submenu has opened.
|
535
|
+
* @event Drilldown#open
|
536
|
+
*/
|
537
|
+
this.$element.trigger('open.zf.drilldown', [$elem]);
|
538
|
+
}
|
539
|
+
}, {
|
540
|
+
key: '_hide',
|
541
|
+
|
542
|
+
|
543
|
+
/**
|
544
|
+
* Hides a submenu
|
545
|
+
* @function
|
546
|
+
* @fires Drilldown#hide
|
547
|
+
* @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.
|
548
|
+
*/
|
549
|
+
value: function _hide($elem) {
|
550
|
+
if (this.options.autoHeight) this.$wrapper.css({ height: $elem.parent().closest('ul').data('calcHeight') });
|
551
|
+
var _this = this;
|
552
|
+
$elem.parent('li').attr('aria-expanded', false);
|
553
|
+
$elem.attr('aria-hidden', true).addClass('is-closing');
|
554
|
+
$elem.addClass('is-closing').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($elem), function () {
|
555
|
+
$elem.removeClass('is-active is-closing');
|
556
|
+
$elem.blur().addClass('invisible');
|
557
|
+
});
|
558
|
+
/**
|
559
|
+
* Fires when the submenu has closed.
|
560
|
+
* @event Drilldown#hide
|
561
|
+
*/
|
562
|
+
$elem.trigger('hide.zf.drilldown', [$elem]);
|
563
|
+
}
|
564
|
+
|
565
|
+
/**
|
566
|
+
* Iterates through the nested menus to calculate the min-height, and max-width for the menu.
|
567
|
+
* Prevents content jumping.
|
568
|
+
* @function
|
569
|
+
* @private
|
570
|
+
*/
|
571
|
+
|
572
|
+
}, {
|
573
|
+
key: '_getMaxDims',
|
574
|
+
value: function _getMaxDims() {
|
575
|
+
var maxHeight = 0,
|
576
|
+
result = {},
|
577
|
+
_this = this;
|
578
|
+
this.$submenus.add(this.$element).each(function () {
|
579
|
+
var numOfElems = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('li').length;
|
580
|
+
var height = __WEBPACK_IMPORTED_MODULE_4__foundation_util_box__["Box"].GetDimensions(this).height;
|
581
|
+
maxHeight = height > maxHeight ? height : maxHeight;
|
582
|
+
if (_this.options.autoHeight) {
|
583
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('calcHeight', height);
|
584
|
+
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).hasClass('is-drilldown-submenu')) result['height'] = height;
|
585
|
+
}
|
586
|
+
});
|
587
|
+
|
588
|
+
if (!this.options.autoHeight) result['min-height'] = maxHeight + 'px';
|
589
|
+
|
590
|
+
result['max-width'] = this.$element[0].getBoundingClientRect().width + 'px';
|
591
|
+
|
592
|
+
return result;
|
593
|
+
}
|
594
|
+
|
595
|
+
/**
|
596
|
+
* Destroys the Drilldown Menu
|
597
|
+
* @function
|
598
|
+
*/
|
599
|
+
|
600
|
+
}, {
|
601
|
+
key: '_destroy',
|
602
|
+
value: function _destroy() {
|
603
|
+
if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler);
|
604
|
+
this._hideAll();
|
605
|
+
this.$element.off('mutateme.zf.trigger');
|
606
|
+
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Burn(this.$element, 'drilldown');
|
607
|
+
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');
|
608
|
+
this.$submenuAnchors.each(function () {
|
609
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).off('.zf.drilldown');
|
610
|
+
});
|
611
|
+
|
612
|
+
this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');
|
613
|
+
|
614
|
+
this.$element.find('a').each(function () {
|
615
|
+
var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
616
|
+
$link.removeAttr('tabindex');
|
617
|
+
if ($link.data('savedHref')) {
|
618
|
+
$link.attr('href', $link.data('savedHref')).removeData('savedHref');
|
619
|
+
} else {
|
620
|
+
return;
|
621
|
+
}
|
622
|
+
});
|
623
|
+
}
|
624
|
+
}]);
|
625
|
+
|
626
|
+
return Drilldown;
|
627
|
+
}(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__["Plugin"]);
|
628
|
+
|
629
|
+
Drilldown.defaults = {
|
630
|
+
/**
|
631
|
+
* Drilldowns depend on styles in order to function properly; in the default build of Foundation these are
|
632
|
+
* on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.
|
633
|
+
* @option
|
634
|
+
* @type {boolian}
|
635
|
+
* @default true
|
636
|
+
*/
|
637
|
+
autoApplyClass: true,
|
638
|
+
/**
|
639
|
+
* 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.
|
640
|
+
* @option
|
641
|
+
* @type {string}
|
642
|
+
* @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>'
|
643
|
+
*/
|
644
|
+
backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
|
645
|
+
/**
|
646
|
+
* Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.
|
647
|
+
* @option
|
648
|
+
* @type {string}
|
649
|
+
* @default top
|
650
|
+
*/
|
651
|
+
backButtonPosition: 'top',
|
652
|
+
/**
|
653
|
+
* 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.
|
654
|
+
* @option
|
655
|
+
* @type {string}
|
656
|
+
* @default '<div></div>'
|
657
|
+
*/
|
658
|
+
wrapper: '<div></div>',
|
659
|
+
/**
|
660
|
+
* Adds the parent link to the submenu.
|
661
|
+
* @option
|
662
|
+
* @type {boolean}
|
663
|
+
* @default false
|
664
|
+
*/
|
665
|
+
parentLink: false,
|
666
|
+
/**
|
667
|
+
* Allow the menu to return to root list on body click.
|
668
|
+
* @option
|
669
|
+
* @type {boolean}
|
670
|
+
* @default false
|
671
|
+
*/
|
672
|
+
closeOnClick: false,
|
673
|
+
/**
|
674
|
+
* Allow the menu to auto adjust height.
|
675
|
+
* @option
|
676
|
+
* @type {boolean}
|
677
|
+
* @default false
|
678
|
+
*/
|
679
|
+
autoHeight: false,
|
680
|
+
/**
|
681
|
+
* Animate the auto adjust height.
|
682
|
+
* @option
|
683
|
+
* @type {boolean}
|
684
|
+
* @default false
|
685
|
+
*/
|
686
|
+
animateHeight: false,
|
687
|
+
/**
|
688
|
+
* Scroll to the top of the menu after opening a submenu or navigating back using the menu back button
|
689
|
+
* @option
|
690
|
+
* @type {boolean}
|
691
|
+
* @default false
|
692
|
+
*/
|
693
|
+
scrollTop: false,
|
694
|
+
/**
|
695
|
+
* String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken
|
696
|
+
* @option
|
697
|
+
* @type {string}
|
698
|
+
* @default ''
|
699
|
+
*/
|
700
|
+
scrollTopElement: '',
|
701
|
+
/**
|
702
|
+
* ScrollTop offset
|
703
|
+
* @option
|
704
|
+
* @type {number}
|
705
|
+
* @default 0
|
706
|
+
*/
|
707
|
+
scrollTopOffset: 0,
|
708
|
+
/**
|
709
|
+
* Scroll animation duration
|
710
|
+
* @option
|
711
|
+
* @type {number}
|
712
|
+
* @default 500
|
713
|
+
*/
|
714
|
+
animationDuration: 500,
|
715
|
+
/**
|
716
|
+
* Scroll animation easing. Can be `'swing'` or `'linear'`.
|
717
|
+
* @option
|
718
|
+
* @type {string}
|
719
|
+
* @see {@link https://api.jquery.com/animate|JQuery animate}
|
720
|
+
* @default 'swing'
|
721
|
+
*/
|
722
|
+
animationEasing: 'swing'
|
723
|
+
// holdOpen: false
|
724
|
+
};
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
/***/ }),
|
729
|
+
|
730
|
+
/***/ 5:
|
731
|
+
/***/ (function(module, exports) {
|
732
|
+
|
733
|
+
module.exports = {Keyboard: window.Foundation.Keyboard};
|
734
|
+
|
735
|
+
/***/ }),
|
736
|
+
|
737
|
+
/***/ 8:
|
738
|
+
/***/ (function(module, exports) {
|
739
|
+
|
740
|
+
module.exports = {Box: window.Foundation.Box};
|
741
|
+
|
742
|
+
/***/ }),
|
743
|
+
|
744
|
+
/***/ 82:
|
745
|
+
/***/ (function(module, exports, __webpack_require__) {
|
746
|
+
|
747
|
+
module.exports = __webpack_require__(16);
|
748
|
+
|
749
|
+
|
750
|
+
/***/ }),
|
751
|
+
|
752
|
+
/***/ 9:
|
753
|
+
/***/ (function(module, exports) {
|
754
|
+
|
755
|
+
module.exports = {Nest: window.Foundation.Nest};
|
756
|
+
|
757
|
+
/***/ })
|
758
|
+
|
759
|
+
/******/ });
|