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,511 @@
|
|
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 = 80);
|
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
|
+
/***/ 14:
|
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_accordion__ = __webpack_require__(44);
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_accordion__["a" /* Accordion */], 'Accordion');
|
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
|
+
/***/ 44:
|
115
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
116
|
+
|
117
|
+
"use strict";
|
118
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Accordion; });
|
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_core__ = __webpack_require__(3);
|
124
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__);
|
125
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
126
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
127
|
+
|
128
|
+
|
129
|
+
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; }; }();
|
130
|
+
|
131
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
132
|
+
|
133
|
+
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; }
|
134
|
+
|
135
|
+
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; }
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Accordion module.
|
144
|
+
* @module foundation.accordion
|
145
|
+
* @requires foundation.util.keyboard
|
146
|
+
*/
|
147
|
+
|
148
|
+
var Accordion = function (_Plugin) {
|
149
|
+
_inherits(Accordion, _Plugin);
|
150
|
+
|
151
|
+
function Accordion() {
|
152
|
+
_classCallCheck(this, Accordion);
|
153
|
+
|
154
|
+
return _possibleConstructorReturn(this, (Accordion.__proto__ || Object.getPrototypeOf(Accordion)).apply(this, arguments));
|
155
|
+
}
|
156
|
+
|
157
|
+
_createClass(Accordion, [{
|
158
|
+
key: '_setup',
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Creates a new instance of an accordion.
|
162
|
+
* @class
|
163
|
+
* @name Accordion
|
164
|
+
* @fires Accordion#init
|
165
|
+
* @param {jQuery} element - jQuery object to make into an accordion.
|
166
|
+
* @param {Object} options - a plain object with settings to override the default options.
|
167
|
+
*/
|
168
|
+
value: function _setup(element, options) {
|
169
|
+
this.$element = element;
|
170
|
+
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Accordion.defaults, this.$element.data(), options);
|
171
|
+
|
172
|
+
this.className = 'Accordion'; // ie9 back compat
|
173
|
+
this._init();
|
174
|
+
|
175
|
+
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Accordion', {
|
176
|
+
'ENTER': 'toggle',
|
177
|
+
'SPACE': 'toggle',
|
178
|
+
'ARROW_DOWN': 'next',
|
179
|
+
'ARROW_UP': 'previous'
|
180
|
+
});
|
181
|
+
}
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Initializes the accordion by animating the preset active pane(s).
|
185
|
+
* @private
|
186
|
+
*/
|
187
|
+
|
188
|
+
}, {
|
189
|
+
key: '_init',
|
190
|
+
value: function _init() {
|
191
|
+
var _this3 = this;
|
192
|
+
|
193
|
+
this.$element.attr('role', 'tablist');
|
194
|
+
this.$tabs = this.$element.children('[data-accordion-item]');
|
195
|
+
|
196
|
+
this.$tabs.each(function (idx, el) {
|
197
|
+
var $el = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el),
|
198
|
+
$content = $el.children('[data-tab-content]'),
|
199
|
+
id = $content[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["GetYoDigits"])(6, 'accordion'),
|
200
|
+
linkId = el.id || id + '-label';
|
201
|
+
|
202
|
+
$el.find('a:first').attr({
|
203
|
+
'aria-controls': id,
|
204
|
+
'role': 'tab',
|
205
|
+
'id': linkId,
|
206
|
+
'aria-expanded': false,
|
207
|
+
'aria-selected': false
|
208
|
+
});
|
209
|
+
|
210
|
+
$content.attr({ 'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id });
|
211
|
+
});
|
212
|
+
var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
|
213
|
+
this.firstTimeInit = true;
|
214
|
+
if ($initActive.length) {
|
215
|
+
this.down($initActive, this.firstTimeInit);
|
216
|
+
this.firstTimeInit = false;
|
217
|
+
}
|
218
|
+
|
219
|
+
this._checkDeepLink = function () {
|
220
|
+
var anchor = window.location.hash;
|
221
|
+
//need a hash and a relevant anchor in this tabset
|
222
|
+
if (anchor.length) {
|
223
|
+
var $link = _this3.$element.find('[href$="' + anchor + '"]'),
|
224
|
+
$anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor);
|
225
|
+
|
226
|
+
if ($link.length && $anchor) {
|
227
|
+
if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
|
228
|
+
_this3.down($anchor, _this3.firstTimeInit);
|
229
|
+
_this3.firstTimeInit = false;
|
230
|
+
};
|
231
|
+
|
232
|
+
//roll up a little to show the titles
|
233
|
+
if (_this3.options.deepLinkSmudge) {
|
234
|
+
var _this = _this3;
|
235
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).load(function () {
|
236
|
+
var offset = _this.$element.offset();
|
237
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);
|
238
|
+
});
|
239
|
+
}
|
240
|
+
|
241
|
+
/**
|
242
|
+
* Fires when the zplugin has deeplinked at pageload
|
243
|
+
* @event Accordion#deeplink
|
244
|
+
*/
|
245
|
+
_this3.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);
|
246
|
+
}
|
247
|
+
}
|
248
|
+
};
|
249
|
+
|
250
|
+
//use browser to open a tab, if it exists in this tabset
|
251
|
+
if (this.options.deepLink) {
|
252
|
+
this._checkDeepLink();
|
253
|
+
}
|
254
|
+
|
255
|
+
this._events();
|
256
|
+
}
|
257
|
+
|
258
|
+
/**
|
259
|
+
* Adds event handlers for items within the accordion.
|
260
|
+
* @private
|
261
|
+
*/
|
262
|
+
|
263
|
+
}, {
|
264
|
+
key: '_events',
|
265
|
+
value: function _events() {
|
266
|
+
var _this = this;
|
267
|
+
|
268
|
+
this.$tabs.each(function () {
|
269
|
+
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
270
|
+
var $tabContent = $elem.children('[data-tab-content]');
|
271
|
+
if ($tabContent.length) {
|
272
|
+
$elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) {
|
273
|
+
e.preventDefault();
|
274
|
+
_this.toggle($tabContent);
|
275
|
+
}).on('keydown.zf.accordion', function (e) {
|
276
|
+
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Accordion', {
|
277
|
+
toggle: function () {
|
278
|
+
_this.toggle($tabContent);
|
279
|
+
},
|
280
|
+
next: function () {
|
281
|
+
var $a = $elem.next().find('a').focus();
|
282
|
+
if (!_this.options.multiExpand) {
|
283
|
+
$a.trigger('click.zf.accordion');
|
284
|
+
}
|
285
|
+
},
|
286
|
+
previous: function () {
|
287
|
+
var $a = $elem.prev().find('a').focus();
|
288
|
+
if (!_this.options.multiExpand) {
|
289
|
+
$a.trigger('click.zf.accordion');
|
290
|
+
}
|
291
|
+
},
|
292
|
+
handled: function () {
|
293
|
+
e.preventDefault();
|
294
|
+
e.stopPropagation();
|
295
|
+
}
|
296
|
+
});
|
297
|
+
});
|
298
|
+
}
|
299
|
+
});
|
300
|
+
if (this.options.deepLink) {
|
301
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._checkDeepLink);
|
302
|
+
}
|
303
|
+
}
|
304
|
+
|
305
|
+
/**
|
306
|
+
* Toggles the selected content pane's open/close state.
|
307
|
+
* @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).
|
308
|
+
* @function
|
309
|
+
*/
|
310
|
+
|
311
|
+
}, {
|
312
|
+
key: 'toggle',
|
313
|
+
value: function toggle($target) {
|
314
|
+
if ($target.closest('[data-accordion]').is('[disabled]')) {
|
315
|
+
console.info('Cannot toggle an accordion that is disabled.');
|
316
|
+
return;
|
317
|
+
}
|
318
|
+
if ($target.parent().hasClass('is-active')) {
|
319
|
+
this.up($target);
|
320
|
+
} else {
|
321
|
+
this.down($target);
|
322
|
+
}
|
323
|
+
//either replace or update browser history
|
324
|
+
if (this.options.deepLink) {
|
325
|
+
var anchor = $target.prev('a').attr('href');
|
326
|
+
|
327
|
+
if (this.options.updateHistory) {
|
328
|
+
history.pushState({}, '', anchor);
|
329
|
+
} else {
|
330
|
+
history.replaceState({}, '', anchor);
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
|
335
|
+
/**
|
336
|
+
* Opens the accordion tab defined by `$target`.
|
337
|
+
* @param {jQuery} $target - Accordion pane to open (`.accordion-content`).
|
338
|
+
* @param {Boolean} firstTime - flag to determine if reflow should happen.
|
339
|
+
* @fires Accordion#down
|
340
|
+
* @function
|
341
|
+
*/
|
342
|
+
|
343
|
+
}, {
|
344
|
+
key: 'down',
|
345
|
+
value: function down($target, firstTime) {
|
346
|
+
var _this4 = this;
|
347
|
+
|
348
|
+
/**
|
349
|
+
* checking firstTime allows for initial render of the accordion
|
350
|
+
* to render preset is-active panes.
|
351
|
+
*/
|
352
|
+
if ($target.closest('[data-accordion]').is('[disabled]') && !firstTime) {
|
353
|
+
console.info('Cannot call down on an accordion that is disabled.');
|
354
|
+
return;
|
355
|
+
}
|
356
|
+
$target.attr('aria-hidden', false).parent('[data-tab-content]').addBack().parent().addClass('is-active');
|
357
|
+
|
358
|
+
if (!this.options.multiExpand && !firstTime) {
|
359
|
+
var $currentActive = this.$element.children('.is-active').children('[data-tab-content]');
|
360
|
+
if ($currentActive.length) {
|
361
|
+
this.up($currentActive.not($target));
|
362
|
+
}
|
363
|
+
}
|
364
|
+
|
365
|
+
$target.slideDown(this.options.slideSpeed, function () {
|
366
|
+
/**
|
367
|
+
* Fires when the tab is done opening.
|
368
|
+
* @event Accordion#down
|
369
|
+
*/
|
370
|
+
_this4.$element.trigger('down.zf.accordion', [$target]);
|
371
|
+
});
|
372
|
+
|
373
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target.attr('aria-labelledby')).attr({
|
374
|
+
'aria-expanded': true,
|
375
|
+
'aria-selected': true
|
376
|
+
});
|
377
|
+
}
|
378
|
+
|
379
|
+
/**
|
380
|
+
* Closes the tab defined by `$target`.
|
381
|
+
* @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
|
382
|
+
* @fires Accordion#up
|
383
|
+
* @function
|
384
|
+
*/
|
385
|
+
|
386
|
+
}, {
|
387
|
+
key: 'up',
|
388
|
+
value: function up($target) {
|
389
|
+
if ($target.closest('[data-accordion]').is('[disabled]')) {
|
390
|
+
console.info('Cannot call up on an accordion that is disabled.');
|
391
|
+
return;
|
392
|
+
}
|
393
|
+
|
394
|
+
var $aunts = $target.parent().siblings(),
|
395
|
+
_this = this;
|
396
|
+
|
397
|
+
if (!this.options.allowAllClosed && !$aunts.hasClass('is-active') || !$target.parent().hasClass('is-active')) {
|
398
|
+
return;
|
399
|
+
}
|
400
|
+
|
401
|
+
$target.slideUp(_this.options.slideSpeed, function () {
|
402
|
+
/**
|
403
|
+
* Fires when the tab is done collapsing up.
|
404
|
+
* @event Accordion#up
|
405
|
+
*/
|
406
|
+
_this.$element.trigger('up.zf.accordion', [$target]);
|
407
|
+
});
|
408
|
+
|
409
|
+
$target.attr('aria-hidden', true).parent().removeClass('is-active');
|
410
|
+
|
411
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target.attr('aria-labelledby')).attr({
|
412
|
+
'aria-expanded': false,
|
413
|
+
'aria-selected': false
|
414
|
+
});
|
415
|
+
}
|
416
|
+
|
417
|
+
/**
|
418
|
+
* Destroys an instance of an accordion.
|
419
|
+
* @fires Accordion#destroyed
|
420
|
+
* @function
|
421
|
+
*/
|
422
|
+
|
423
|
+
}, {
|
424
|
+
key: '_destroy',
|
425
|
+
value: function _destroy() {
|
426
|
+
this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
|
427
|
+
this.$element.find('a').off('.zf.accordion');
|
428
|
+
if (this.options.deepLink) {
|
429
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink);
|
430
|
+
}
|
431
|
+
}
|
432
|
+
}]);
|
433
|
+
|
434
|
+
return Accordion;
|
435
|
+
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
436
|
+
|
437
|
+
Accordion.defaults = {
|
438
|
+
/**
|
439
|
+
* Amount of time to animate the opening of an accordion pane.
|
440
|
+
* @option
|
441
|
+
* @type {number}
|
442
|
+
* @default 250
|
443
|
+
*/
|
444
|
+
slideSpeed: 250,
|
445
|
+
/**
|
446
|
+
* Allow the accordion to have multiple open panes.
|
447
|
+
* @option
|
448
|
+
* @type {boolean}
|
449
|
+
* @default false
|
450
|
+
*/
|
451
|
+
multiExpand: false,
|
452
|
+
/**
|
453
|
+
* Allow the accordion to close all panes.
|
454
|
+
* @option
|
455
|
+
* @type {boolean}
|
456
|
+
* @default false
|
457
|
+
*/
|
458
|
+
allowAllClosed: false,
|
459
|
+
/**
|
460
|
+
* Allows the window to scroll to content of pane specified by hash anchor
|
461
|
+
* @option
|
462
|
+
* @type {boolean}
|
463
|
+
* @default false
|
464
|
+
*/
|
465
|
+
deepLink: false,
|
466
|
+
|
467
|
+
/**
|
468
|
+
* Adjust the deep link scroll to make sure the top of the accordion panel is visible
|
469
|
+
* @option
|
470
|
+
* @type {boolean}
|
471
|
+
* @default false
|
472
|
+
*/
|
473
|
+
deepLinkSmudge: false,
|
474
|
+
|
475
|
+
/**
|
476
|
+
* Animation time (ms) for the deep link adjustment
|
477
|
+
* @option
|
478
|
+
* @type {number}
|
479
|
+
* @default 300
|
480
|
+
*/
|
481
|
+
deepLinkSmudgeDelay: 300,
|
482
|
+
|
483
|
+
/**
|
484
|
+
* Update the browser history with the open accordion
|
485
|
+
* @option
|
486
|
+
* @type {boolean}
|
487
|
+
* @default false
|
488
|
+
*/
|
489
|
+
updateHistory: false
|
490
|
+
};
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
/***/ }),
|
495
|
+
|
496
|
+
/***/ 5:
|
497
|
+
/***/ (function(module, exports) {
|
498
|
+
|
499
|
+
module.exports = {Keyboard: window.Foundation.Keyboard};
|
500
|
+
|
501
|
+
/***/ }),
|
502
|
+
|
503
|
+
/***/ 80:
|
504
|
+
/***/ (function(module, exports, __webpack_require__) {
|
505
|
+
|
506
|
+
module.exports = __webpack_require__(14);
|
507
|
+
|
508
|
+
|
509
|
+
/***/ })
|
510
|
+
|
511
|
+
/******/ });
|