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,303 @@
|
|
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 = 95);
|
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
|
+
/***/ 2:
|
86
|
+
/***/ (function(module, exports) {
|
87
|
+
|
88
|
+
module.exports = {Plugin: window.Foundation.Plugin};
|
89
|
+
|
90
|
+
/***/ }),
|
91
|
+
|
92
|
+
/***/ 29:
|
93
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
94
|
+
|
95
|
+
"use strict";
|
96
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
97
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
98
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
99
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_smoothScroll__ = __webpack_require__(59);
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_smoothScroll__["a" /* SmoothScroll */], 'SmoothScroll');
|
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
|
+
/***/ 59:
|
115
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
116
|
+
|
117
|
+
"use strict";
|
118
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SmoothScroll; });
|
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_core__ = __webpack_require__(3);
|
122
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__);
|
123
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2);
|
124
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__);
|
125
|
+
|
126
|
+
|
127
|
+
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; }; }();
|
128
|
+
|
129
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
130
|
+
|
131
|
+
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; }
|
132
|
+
|
133
|
+
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; }
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
/**
|
140
|
+
* SmoothScroll module.
|
141
|
+
* @module foundation.smooth-scroll
|
142
|
+
*/
|
143
|
+
|
144
|
+
var SmoothScroll = function (_Plugin) {
|
145
|
+
_inherits(SmoothScroll, _Plugin);
|
146
|
+
|
147
|
+
function SmoothScroll() {
|
148
|
+
_classCallCheck(this, SmoothScroll);
|
149
|
+
|
150
|
+
return _possibleConstructorReturn(this, (SmoothScroll.__proto__ || Object.getPrototypeOf(SmoothScroll)).apply(this, arguments));
|
151
|
+
}
|
152
|
+
|
153
|
+
_createClass(SmoothScroll, [{
|
154
|
+
key: '_setup',
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Creates a new instance of SmoothScroll.
|
158
|
+
* @class
|
159
|
+
* @name SmoothScroll
|
160
|
+
* @fires SmoothScroll#init
|
161
|
+
* @param {Object} element - jQuery object to add the trigger to.
|
162
|
+
* @param {Object} options - Overrides to the default plugin settings.
|
163
|
+
*/
|
164
|
+
value: function _setup(element, options) {
|
165
|
+
this.$element = element;
|
166
|
+
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options);
|
167
|
+
this.className = 'SmoothScroll'; // ie9 back compat
|
168
|
+
|
169
|
+
this._init();
|
170
|
+
}
|
171
|
+
|
172
|
+
/**
|
173
|
+
* Initialize the SmoothScroll plugin
|
174
|
+
* @private
|
175
|
+
*/
|
176
|
+
|
177
|
+
}, {
|
178
|
+
key: '_init',
|
179
|
+
value: function _init() {
|
180
|
+
var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["GetYoDigits"])(6, 'smooth-scroll');
|
181
|
+
var _this = this;
|
182
|
+
this.$element.attr({
|
183
|
+
'id': id
|
184
|
+
});
|
185
|
+
|
186
|
+
this._events();
|
187
|
+
}
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Initializes events for SmoothScroll.
|
191
|
+
* @private
|
192
|
+
*/
|
193
|
+
|
194
|
+
}, {
|
195
|
+
key: '_events',
|
196
|
+
value: function _events() {
|
197
|
+
var _this = this;
|
198
|
+
|
199
|
+
// click handler function.
|
200
|
+
var handleLinkClick = function (e) {
|
201
|
+
// exit function if the event source isn't coming from an anchor with href attribute starts with '#'
|
202
|
+
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is('a[href^="#"]')) {
|
203
|
+
return false;
|
204
|
+
}
|
205
|
+
|
206
|
+
var arrival = this.getAttribute('href');
|
207
|
+
|
208
|
+
_this._inTransition = true;
|
209
|
+
|
210
|
+
SmoothScroll.scrollToLoc(arrival, _this.options, function () {
|
211
|
+
_this._inTransition = false;
|
212
|
+
});
|
213
|
+
|
214
|
+
e.preventDefault();
|
215
|
+
};
|
216
|
+
|
217
|
+
this.$element.on('click.zf.smoothScroll', handleLinkClick);
|
218
|
+
this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', handleLinkClick);
|
219
|
+
}
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Function to scroll to a given location on the page.
|
223
|
+
* @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'
|
224
|
+
* @param {Object} options - The options to use.
|
225
|
+
* @param {Function} callback - The callback function.
|
226
|
+
* @static
|
227
|
+
* @function
|
228
|
+
*/
|
229
|
+
|
230
|
+
}], [{
|
231
|
+
key: 'scrollToLoc',
|
232
|
+
value: function scrollToLoc(loc) {
|
233
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults;
|
234
|
+
var callback = arguments[2];
|
235
|
+
|
236
|
+
// Do nothing if target does not exist to prevent errors
|
237
|
+
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(loc).length) {
|
238
|
+
return false;
|
239
|
+
}
|
240
|
+
|
241
|
+
var scrollPos = Math.round(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(loc).offset().top - options.threshold / 2 - options.offset);
|
242
|
+
|
243
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').stop(true).animate({ scrollTop: scrollPos }, options.animationDuration, options.animationEasing, function () {
|
244
|
+
if (callback && typeof callback == "function") {
|
245
|
+
callback();
|
246
|
+
}
|
247
|
+
});
|
248
|
+
}
|
249
|
+
}]);
|
250
|
+
|
251
|
+
return SmoothScroll;
|
252
|
+
}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["Plugin"]);
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Default settings for plugin.
|
256
|
+
*/
|
257
|
+
|
258
|
+
|
259
|
+
SmoothScroll.defaults = {
|
260
|
+
/**
|
261
|
+
* Amount of time, in ms, the animated scrolling should take between locations.
|
262
|
+
* @option
|
263
|
+
* @type {number}
|
264
|
+
* @default 500
|
265
|
+
*/
|
266
|
+
animationDuration: 500,
|
267
|
+
/**
|
268
|
+
* Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
|
269
|
+
* @option
|
270
|
+
* @type {string}
|
271
|
+
* @default 'linear'
|
272
|
+
* @see {@link https://api.jquery.com/animate|Jquery animate}
|
273
|
+
*/
|
274
|
+
animationEasing: 'linear',
|
275
|
+
/**
|
276
|
+
* Number of pixels to use as a marker for location changes.
|
277
|
+
* @option
|
278
|
+
* @type {number}
|
279
|
+
* @default 50
|
280
|
+
*/
|
281
|
+
threshold: 50,
|
282
|
+
/**
|
283
|
+
* Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
|
284
|
+
* @option
|
285
|
+
* @type {number}
|
286
|
+
* @default 0
|
287
|
+
*/
|
288
|
+
offset: 0
|
289
|
+
};
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
/***/ }),
|
294
|
+
|
295
|
+
/***/ 95:
|
296
|
+
/***/ (function(module, exports, __webpack_require__) {
|
297
|
+
|
298
|
+
module.exports = __webpack_require__(29);
|
299
|
+
|
300
|
+
|
301
|
+
/***/ })
|
302
|
+
|
303
|
+
/******/ });
|
@@ -0,0 +1,1001 @@
|
|
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 = 96);
|
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
|
+
/***/ 2:
|
86
|
+
/***/ (function(module, exports) {
|
87
|
+
|
88
|
+
module.exports = {Plugin: window.Foundation.Plugin};
|
89
|
+
|
90
|
+
/***/ }),
|
91
|
+
|
92
|
+
/***/ 3:
|
93
|
+
/***/ (function(module, exports) {
|
94
|
+
|
95
|
+
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
96
|
+
|
97
|
+
/***/ }),
|
98
|
+
|
99
|
+
/***/ 30:
|
100
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
101
|
+
|
102
|
+
"use strict";
|
103
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
104
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
105
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
106
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_sticky__ = __webpack_require__(60);
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_sticky__["a" /* Sticky */], 'Sticky');
|
111
|
+
|
112
|
+
/***/ }),
|
113
|
+
|
114
|
+
/***/ 4:
|
115
|
+
/***/ (function(module, exports) {
|
116
|
+
|
117
|
+
module.exports = {Motion: window.Foundation.Motion, Move: window.Foundation.Move};
|
118
|
+
|
119
|
+
/***/ }),
|
120
|
+
|
121
|
+
/***/ 6:
|
122
|
+
/***/ (function(module, exports) {
|
123
|
+
|
124
|
+
module.exports = {MediaQuery: window.Foundation.MediaQuery};
|
125
|
+
|
126
|
+
/***/ }),
|
127
|
+
|
128
|
+
/***/ 60:
|
129
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
130
|
+
|
131
|
+
"use strict";
|
132
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Sticky; });
|
133
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
134
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
135
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(3);
|
136
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__);
|
137
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(6);
|
138
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__);
|
139
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
140
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
141
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_triggers__ = __webpack_require__(7);
|
142
|
+
|
143
|
+
|
144
|
+
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; }; }();
|
145
|
+
|
146
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
147
|
+
|
148
|
+
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; }
|
149
|
+
|
150
|
+
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; }
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Sticky module.
|
160
|
+
* @module foundation.sticky
|
161
|
+
* @requires foundation.util.triggers
|
162
|
+
* @requires foundation.util.mediaQuery
|
163
|
+
*/
|
164
|
+
|
165
|
+
var Sticky = function (_Plugin) {
|
166
|
+
_inherits(Sticky, _Plugin);
|
167
|
+
|
168
|
+
function Sticky() {
|
169
|
+
_classCallCheck(this, Sticky);
|
170
|
+
|
171
|
+
return _possibleConstructorReturn(this, (Sticky.__proto__ || Object.getPrototypeOf(Sticky)).apply(this, arguments));
|
172
|
+
}
|
173
|
+
|
174
|
+
_createClass(Sticky, [{
|
175
|
+
key: '_setup',
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Creates a new instance of a sticky thing.
|
179
|
+
* @class
|
180
|
+
* @name Sticky
|
181
|
+
* @param {jQuery} element - jQuery object to make sticky.
|
182
|
+
* @param {Object} options - options object passed when creating the element programmatically.
|
183
|
+
*/
|
184
|
+
value: function _setup(element, options) {
|
185
|
+
this.$element = element;
|
186
|
+
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Sticky.defaults, this.$element.data(), options);
|
187
|
+
this.className = 'Sticky'; // ie9 back compat
|
188
|
+
|
189
|
+
// Triggers init is idempotent, just need to make sure it is initialized
|
190
|
+
__WEBPACK_IMPORTED_MODULE_4__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a);
|
191
|
+
|
192
|
+
this._init();
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes
|
197
|
+
* @function
|
198
|
+
* @private
|
199
|
+
*/
|
200
|
+
|
201
|
+
}, {
|
202
|
+
key: '_init',
|
203
|
+
value: function _init() {
|
204
|
+
__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["MediaQuery"]._init();
|
205
|
+
|
206
|
+
var $parent = this.$element.parent('[data-sticky-container]'),
|
207
|
+
id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["GetYoDigits"])(6, 'sticky'),
|
208
|
+
_this = this;
|
209
|
+
|
210
|
+
if ($parent.length) {
|
211
|
+
this.$container = $parent;
|
212
|
+
} else {
|
213
|
+
this.wasWrapped = true;
|
214
|
+
this.$element.wrap(this.options.container);
|
215
|
+
this.$container = this.$element.parent();
|
216
|
+
}
|
217
|
+
this.$container.addClass(this.options.containerClass);
|
218
|
+
|
219
|
+
this.$element.addClass(this.options.stickyClass).attr({ 'data-resize': id, 'data-mutate': id });
|
220
|
+
if (this.options.anchor !== '') {
|
221
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + _this.options.anchor).attr({ 'data-mutate': id });
|
222
|
+
}
|
223
|
+
|
224
|
+
this.scrollCount = this.options.checkEvery;
|
225
|
+
this.isStuck = false;
|
226
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).one('load.zf.sticky', function () {
|
227
|
+
//We calculate the container height to have correct values for anchor points offset calculation.
|
228
|
+
_this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height;
|
229
|
+
_this.$container.css('height', _this.containerHeight);
|
230
|
+
_this.elemHeight = _this.containerHeight;
|
231
|
+
if (_this.options.anchor !== '') {
|
232
|
+
_this.$anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + _this.options.anchor);
|
233
|
+
} else {
|
234
|
+
_this._parsePoints();
|
235
|
+
}
|
236
|
+
|
237
|
+
_this._setSizes(function () {
|
238
|
+
var scroll = window.pageYOffset;
|
239
|
+
_this._calc(false, scroll);
|
240
|
+
//Unstick the element will ensure that proper classes are set.
|
241
|
+
if (!_this.isStuck) {
|
242
|
+
_this._removeSticky(scroll >= _this.topPoint ? false : true);
|
243
|
+
}
|
244
|
+
});
|
245
|
+
_this._events(id.split('-').reverse().join('-'));
|
246
|
+
});
|
247
|
+
}
|
248
|
+
|
249
|
+
/**
|
250
|
+
* If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on.
|
251
|
+
* @function
|
252
|
+
* @private
|
253
|
+
*/
|
254
|
+
|
255
|
+
}, {
|
256
|
+
key: '_parsePoints',
|
257
|
+
value: function _parsePoints() {
|
258
|
+
var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor,
|
259
|
+
btm = this.options.btmAnchor == "" ? document.documentElement.scrollHeight : this.options.btmAnchor,
|
260
|
+
pts = [top, btm],
|
261
|
+
breaks = {};
|
262
|
+
for (var i = 0, len = pts.length; i < len && pts[i]; i++) {
|
263
|
+
var pt;
|
264
|
+
if (typeof pts[i] === 'number') {
|
265
|
+
pt = pts[i];
|
266
|
+
} else {
|
267
|
+
var place = pts[i].split(':'),
|
268
|
+
anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + place[0]);
|
269
|
+
|
270
|
+
pt = anchor.offset().top;
|
271
|
+
if (place[1] && place[1].toLowerCase() === 'bottom') {
|
272
|
+
pt += anchor[0].getBoundingClientRect().height;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
breaks[i] = pt;
|
276
|
+
}
|
277
|
+
|
278
|
+
this.points = breaks;
|
279
|
+
return;
|
280
|
+
}
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Adds event handlers for the scrolling element.
|
284
|
+
* @private
|
285
|
+
* @param {String} id - pseudo-random id for unique scroll event listener.
|
286
|
+
*/
|
287
|
+
|
288
|
+
}, {
|
289
|
+
key: '_events',
|
290
|
+
value: function _events(id) {
|
291
|
+
var _this = this,
|
292
|
+
scrollListener = this.scrollListener = 'scroll.zf.' + id;
|
293
|
+
if (this.isOn) {
|
294
|
+
return;
|
295
|
+
}
|
296
|
+
if (this.canStick) {
|
297
|
+
this.isOn = true;
|
298
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(scrollListener).on(scrollListener, function (e) {
|
299
|
+
if (_this.scrollCount === 0) {
|
300
|
+
_this.scrollCount = _this.options.checkEvery;
|
301
|
+
_this._setSizes(function () {
|
302
|
+
_this._calc(false, window.pageYOffset);
|
303
|
+
});
|
304
|
+
} else {
|
305
|
+
_this.scrollCount--;
|
306
|
+
_this._calc(false, window.pageYOffset);
|
307
|
+
}
|
308
|
+
});
|
309
|
+
}
|
310
|
+
|
311
|
+
this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function (e, el) {
|
312
|
+
_this._eventsHandler(id);
|
313
|
+
});
|
314
|
+
|
315
|
+
this.$element.on('mutateme.zf.trigger', function (e, el) {
|
316
|
+
_this._eventsHandler(id);
|
317
|
+
});
|
318
|
+
|
319
|
+
if (this.$anchor) {
|
320
|
+
this.$anchor.on('mutateme.zf.trigger', function (e, el) {
|
321
|
+
_this._eventsHandler(id);
|
322
|
+
});
|
323
|
+
}
|
324
|
+
}
|
325
|
+
|
326
|
+
/**
|
327
|
+
* Handler for events.
|
328
|
+
* @private
|
329
|
+
* @param {String} id - pseudo-random id for unique scroll event listener.
|
330
|
+
*/
|
331
|
+
|
332
|
+
}, {
|
333
|
+
key: '_eventsHandler',
|
334
|
+
value: function _eventsHandler(id) {
|
335
|
+
var _this = this,
|
336
|
+
scrollListener = this.scrollListener = 'scroll.zf.' + id;
|
337
|
+
|
338
|
+
_this._setSizes(function () {
|
339
|
+
_this._calc(false);
|
340
|
+
if (_this.canStick) {
|
341
|
+
if (!_this.isOn) {
|
342
|
+
_this._events(id);
|
343
|
+
}
|
344
|
+
} else if (_this.isOn) {
|
345
|
+
_this._pauseListeners(scrollListener);
|
346
|
+
}
|
347
|
+
});
|
348
|
+
}
|
349
|
+
|
350
|
+
/**
|
351
|
+
* Removes event handlers for scroll and change events on anchor.
|
352
|
+
* @fires Sticky#pause
|
353
|
+
* @param {String} scrollListener - unique, namespaced scroll listener attached to `window`
|
354
|
+
*/
|
355
|
+
|
356
|
+
}, {
|
357
|
+
key: '_pauseListeners',
|
358
|
+
value: function _pauseListeners(scrollListener) {
|
359
|
+
this.isOn = false;
|
360
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(scrollListener);
|
361
|
+
|
362
|
+
/**
|
363
|
+
* Fires when the plugin is paused due to resize event shrinking the view.
|
364
|
+
* @event Sticky#pause
|
365
|
+
* @private
|
366
|
+
*/
|
367
|
+
this.$element.trigger('pause.zf.sticky');
|
368
|
+
}
|
369
|
+
|
370
|
+
/**
|
371
|
+
* Called on every `scroll` event and on `_init`
|
372
|
+
* fires functions based on booleans and cached values
|
373
|
+
* @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints.
|
374
|
+
* @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`.
|
375
|
+
*/
|
376
|
+
|
377
|
+
}, {
|
378
|
+
key: '_calc',
|
379
|
+
value: function _calc(checkSizes, scroll) {
|
380
|
+
if (checkSizes) {
|
381
|
+
this._setSizes();
|
382
|
+
}
|
383
|
+
|
384
|
+
if (!this.canStick) {
|
385
|
+
if (this.isStuck) {
|
386
|
+
this._removeSticky(true);
|
387
|
+
}
|
388
|
+
return false;
|
389
|
+
}
|
390
|
+
|
391
|
+
if (!scroll) {
|
392
|
+
scroll = window.pageYOffset;
|
393
|
+
}
|
394
|
+
|
395
|
+
if (scroll >= this.topPoint) {
|
396
|
+
if (scroll <= this.bottomPoint) {
|
397
|
+
if (!this.isStuck) {
|
398
|
+
this._setSticky();
|
399
|
+
}
|
400
|
+
} else {
|
401
|
+
if (this.isStuck) {
|
402
|
+
this._removeSticky(false);
|
403
|
+
}
|
404
|
+
}
|
405
|
+
} else {
|
406
|
+
if (this.isStuck) {
|
407
|
+
this._removeSticky(true);
|
408
|
+
}
|
409
|
+
}
|
410
|
+
}
|
411
|
+
|
412
|
+
/**
|
413
|
+
* Causes the $element to become stuck.
|
414
|
+
* Adds `position: fixed;`, and helper classes.
|
415
|
+
* @fires Sticky#stuckto
|
416
|
+
* @function
|
417
|
+
* @private
|
418
|
+
*/
|
419
|
+
|
420
|
+
}, {
|
421
|
+
key: '_setSticky',
|
422
|
+
value: function _setSticky() {
|
423
|
+
var _this = this,
|
424
|
+
stickTo = this.options.stickTo,
|
425
|
+
mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom',
|
426
|
+
notStuckTo = stickTo === 'top' ? 'bottom' : 'top',
|
427
|
+
css = {};
|
428
|
+
|
429
|
+
css[mrgn] = this.options[mrgn] + 'em';
|
430
|
+
css[stickTo] = 0;
|
431
|
+
css[notStuckTo] = 'auto';
|
432
|
+
this.isStuck = true;
|
433
|
+
this.$element.removeClass('is-anchored is-at-' + notStuckTo).addClass('is-stuck is-at-' + stickTo).css(css)
|
434
|
+
/**
|
435
|
+
* Fires when the $element has become `position: fixed;`
|
436
|
+
* Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top`
|
437
|
+
* @event Sticky#stuckto
|
438
|
+
*/
|
439
|
+
.trigger('sticky.zf.stuckto:' + stickTo);
|
440
|
+
this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () {
|
441
|
+
_this._setSizes();
|
442
|
+
});
|
443
|
+
}
|
444
|
+
|
445
|
+
/**
|
446
|
+
* Causes the $element to become unstuck.
|
447
|
+
* Removes `position: fixed;`, and helper classes.
|
448
|
+
* Adds other helper classes.
|
449
|
+
* @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element.
|
450
|
+
* @fires Sticky#unstuckfrom
|
451
|
+
* @private
|
452
|
+
*/
|
453
|
+
|
454
|
+
}, {
|
455
|
+
key: '_removeSticky',
|
456
|
+
value: function _removeSticky(isTop) {
|
457
|
+
var stickTo = this.options.stickTo,
|
458
|
+
stickToTop = stickTo === 'top',
|
459
|
+
css = {},
|
460
|
+
anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight,
|
461
|
+
mrgn = stickToTop ? 'marginTop' : 'marginBottom',
|
462
|
+
notStuckTo = stickToTop ? 'bottom' : 'top',
|
463
|
+
topOrBottom = isTop ? 'top' : 'bottom';
|
464
|
+
|
465
|
+
css[mrgn] = 0;
|
466
|
+
|
467
|
+
css['bottom'] = 'auto';
|
468
|
+
if (isTop) {
|
469
|
+
css['top'] = 0;
|
470
|
+
} else {
|
471
|
+
css['top'] = anchorPt;
|
472
|
+
}
|
473
|
+
|
474
|
+
this.isStuck = false;
|
475
|
+
this.$element.removeClass('is-stuck is-at-' + stickTo).addClass('is-anchored is-at-' + topOrBottom).css(css)
|
476
|
+
/**
|
477
|
+
* Fires when the $element has become anchored.
|
478
|
+
* Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom`
|
479
|
+
* @event Sticky#unstuckfrom
|
480
|
+
*/
|
481
|
+
.trigger('sticky.zf.unstuckfrom:' + topOrBottom);
|
482
|
+
}
|
483
|
+
|
484
|
+
/**
|
485
|
+
* Sets the $element and $container sizes for plugin.
|
486
|
+
* Calls `_setBreakPoints`.
|
487
|
+
* @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`.
|
488
|
+
* @private
|
489
|
+
*/
|
490
|
+
|
491
|
+
}, {
|
492
|
+
key: '_setSizes',
|
493
|
+
value: function _setSizes(cb) {
|
494
|
+
this.canStick = __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["MediaQuery"].is(this.options.stickyOn);
|
495
|
+
if (!this.canStick) {
|
496
|
+
if (cb && typeof cb === 'function') {
|
497
|
+
cb();
|
498
|
+
}
|
499
|
+
}
|
500
|
+
var _this = this,
|
501
|
+
newElemWidth = this.$container[0].getBoundingClientRect().width,
|
502
|
+
comp = window.getComputedStyle(this.$container[0]),
|
503
|
+
pdngl = parseInt(comp['padding-left'], 10),
|
504
|
+
pdngr = parseInt(comp['padding-right'], 10);
|
505
|
+
|
506
|
+
if (this.$anchor && this.$anchor.length) {
|
507
|
+
this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;
|
508
|
+
} else {
|
509
|
+
this._parsePoints();
|
510
|
+
}
|
511
|
+
|
512
|
+
this.$element.css({
|
513
|
+
'max-width': newElemWidth - pdngl - pdngr + 'px'
|
514
|
+
});
|
515
|
+
|
516
|
+
var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;
|
517
|
+
if (this.$element.css("display") == "none") {
|
518
|
+
newContainerHeight = 0;
|
519
|
+
}
|
520
|
+
this.containerHeight = newContainerHeight;
|
521
|
+
this.$container.css({
|
522
|
+
height: newContainerHeight
|
523
|
+
});
|
524
|
+
this.elemHeight = newContainerHeight;
|
525
|
+
|
526
|
+
if (!this.isStuck) {
|
527
|
+
if (this.$element.hasClass('is-at-bottom')) {
|
528
|
+
var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
|
529
|
+
this.$element.css('top', anchorPt);
|
530
|
+
}
|
531
|
+
}
|
532
|
+
|
533
|
+
this._setBreakPoints(newContainerHeight, function () {
|
534
|
+
if (cb && typeof cb === 'function') {
|
535
|
+
cb();
|
536
|
+
}
|
537
|
+
});
|
538
|
+
}
|
539
|
+
|
540
|
+
/**
|
541
|
+
* Sets the upper and lower breakpoints for the element to become sticky/unsticky.
|
542
|
+
* @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`.
|
543
|
+
* @param {Function} cb - optional callback function to be called on completion.
|
544
|
+
* @private
|
545
|
+
*/
|
546
|
+
|
547
|
+
}, {
|
548
|
+
key: '_setBreakPoints',
|
549
|
+
value: function _setBreakPoints(elemHeight, cb) {
|
550
|
+
if (!this.canStick) {
|
551
|
+
if (cb && typeof cb === 'function') {
|
552
|
+
cb();
|
553
|
+
} else {
|
554
|
+
return false;
|
555
|
+
}
|
556
|
+
}
|
557
|
+
var mTop = emCalc(this.options.marginTop),
|
558
|
+
mBtm = emCalc(this.options.marginBottom),
|
559
|
+
topPoint = this.points ? this.points[0] : this.$anchor.offset().top,
|
560
|
+
bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight,
|
561
|
+
|
562
|
+
// topPoint = this.$anchor.offset().top || this.points[0],
|
563
|
+
// bottomPoint = topPoint + this.anchorHeight || this.points[1],
|
564
|
+
winHeight = window.innerHeight;
|
565
|
+
|
566
|
+
if (this.options.stickTo === 'top') {
|
567
|
+
topPoint -= mTop;
|
568
|
+
bottomPoint -= elemHeight + mTop;
|
569
|
+
} else if (this.options.stickTo === 'bottom') {
|
570
|
+
topPoint -= winHeight - (elemHeight + mBtm);
|
571
|
+
bottomPoint -= winHeight - mBtm;
|
572
|
+
} else {
|
573
|
+
//this would be the stickTo: both option... tricky
|
574
|
+
}
|
575
|
+
|
576
|
+
this.topPoint = topPoint;
|
577
|
+
this.bottomPoint = bottomPoint;
|
578
|
+
|
579
|
+
if (cb && typeof cb === 'function') {
|
580
|
+
cb();
|
581
|
+
}
|
582
|
+
}
|
583
|
+
|
584
|
+
/**
|
585
|
+
* Destroys the current sticky element.
|
586
|
+
* Resets the element to the top position first.
|
587
|
+
* Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container.
|
588
|
+
* @function
|
589
|
+
*/
|
590
|
+
|
591
|
+
}, {
|
592
|
+
key: '_destroy',
|
593
|
+
value: function _destroy() {
|
594
|
+
this._removeSticky(true);
|
595
|
+
|
596
|
+
this.$element.removeClass(this.options.stickyClass + ' is-anchored is-at-top').css({
|
597
|
+
height: '',
|
598
|
+
top: '',
|
599
|
+
bottom: '',
|
600
|
+
'max-width': ''
|
601
|
+
}).off('resizeme.zf.trigger').off('mutateme.zf.trigger');
|
602
|
+
if (this.$anchor && this.$anchor.length) {
|
603
|
+
this.$anchor.off('change.zf.sticky');
|
604
|
+
}
|
605
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(this.scrollListener);
|
606
|
+
|
607
|
+
if (this.wasWrapped) {
|
608
|
+
this.$element.unwrap();
|
609
|
+
} else {
|
610
|
+
this.$container.removeClass(this.options.containerClass).css({
|
611
|
+
height: ''
|
612
|
+
});
|
613
|
+
}
|
614
|
+
}
|
615
|
+
}]);
|
616
|
+
|
617
|
+
return Sticky;
|
618
|
+
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
619
|
+
|
620
|
+
Sticky.defaults = {
|
621
|
+
/**
|
622
|
+
* Customizable container template. Add your own classes for styling and sizing.
|
623
|
+
* @option
|
624
|
+
* @type {string}
|
625
|
+
* @default '<div data-sticky-container></div>'
|
626
|
+
*/
|
627
|
+
container: '<div data-sticky-container></div>',
|
628
|
+
/**
|
629
|
+
* Location in the view the element sticks to. Can be `'top'` or `'bottom'`.
|
630
|
+
* @option
|
631
|
+
* @type {string}
|
632
|
+
* @default 'top'
|
633
|
+
*/
|
634
|
+
stickTo: 'top',
|
635
|
+
/**
|
636
|
+
* If anchored to a single element, the id of that element.
|
637
|
+
* @option
|
638
|
+
* @type {string}
|
639
|
+
* @default ''
|
640
|
+
*/
|
641
|
+
anchor: '',
|
642
|
+
/**
|
643
|
+
* If using more than one element as anchor points, the id of the top anchor.
|
644
|
+
* @option
|
645
|
+
* @type {string}
|
646
|
+
* @default ''
|
647
|
+
*/
|
648
|
+
topAnchor: '',
|
649
|
+
/**
|
650
|
+
* If using more than one element as anchor points, the id of the bottom anchor.
|
651
|
+
* @option
|
652
|
+
* @type {string}
|
653
|
+
* @default ''
|
654
|
+
*/
|
655
|
+
btmAnchor: '',
|
656
|
+
/**
|
657
|
+
* Margin, in `em`'s to apply to the top of the element when it becomes sticky.
|
658
|
+
* @option
|
659
|
+
* @type {number}
|
660
|
+
* @default 1
|
661
|
+
*/
|
662
|
+
marginTop: 1,
|
663
|
+
/**
|
664
|
+
* Margin, in `em`'s to apply to the bottom of the element when it becomes sticky.
|
665
|
+
* @option
|
666
|
+
* @type {number}
|
667
|
+
* @default 1
|
668
|
+
*/
|
669
|
+
marginBottom: 1,
|
670
|
+
/**
|
671
|
+
* Breakpoint string that is the minimum screen size an element should become sticky.
|
672
|
+
* @option
|
673
|
+
* @type {string}
|
674
|
+
* @default 'medium'
|
675
|
+
*/
|
676
|
+
stickyOn: 'medium',
|
677
|
+
/**
|
678
|
+
* Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`.
|
679
|
+
* @option
|
680
|
+
* @type {string}
|
681
|
+
* @default 'sticky'
|
682
|
+
*/
|
683
|
+
stickyClass: 'sticky',
|
684
|
+
/**
|
685
|
+
* Class applied to sticky container. Foundation defaults to `sticky-container`.
|
686
|
+
* @option
|
687
|
+
* @type {string}
|
688
|
+
* @default 'sticky-container'
|
689
|
+
*/
|
690
|
+
containerClass: 'sticky-container',
|
691
|
+
/**
|
692
|
+
* Number of scroll events between the plugin's recalculating sticky points. Setting it to `0` will cause it to recalc every scroll event, setting it to `-1` will prevent recalc on scroll.
|
693
|
+
* @option
|
694
|
+
* @type {number}
|
695
|
+
* @default -1
|
696
|
+
*/
|
697
|
+
checkEvery: -1
|
698
|
+
};
|
699
|
+
|
700
|
+
/**
|
701
|
+
* Helper function to calculate em values
|
702
|
+
* @param Number {em} - number of em's to calculate into pixels
|
703
|
+
*/
|
704
|
+
function emCalc(em) {
|
705
|
+
return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em;
|
706
|
+
}
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
/***/ }),
|
711
|
+
|
712
|
+
/***/ 7:
|
713
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
714
|
+
|
715
|
+
"use strict";
|
716
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Triggers; });
|
717
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
718
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
719
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__ = __webpack_require__(4);
|
720
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__);
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
var MutationObserver = function () {
|
727
|
+
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
|
728
|
+
for (var i = 0; i < prefixes.length; i++) {
|
729
|
+
if (prefixes[i] + 'MutationObserver' in window) {
|
730
|
+
return window[prefixes[i] + 'MutationObserver'];
|
731
|
+
}
|
732
|
+
}
|
733
|
+
return false;
|
734
|
+
}();
|
735
|
+
|
736
|
+
var triggers = function (el, type) {
|
737
|
+
el.data(type).split(' ').forEach(function (id) {
|
738
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id)[type === 'close' ? 'trigger' : 'triggerHandler'](type + '.zf.trigger', [el]);
|
739
|
+
});
|
740
|
+
};
|
741
|
+
|
742
|
+
var Triggers = {
|
743
|
+
Listeners: {
|
744
|
+
Basic: {},
|
745
|
+
Global: {}
|
746
|
+
},
|
747
|
+
Initializers: {}
|
748
|
+
};
|
749
|
+
|
750
|
+
Triggers.Listeners.Basic = {
|
751
|
+
openListener: function () {
|
752
|
+
triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'open');
|
753
|
+
},
|
754
|
+
closeListener: function () {
|
755
|
+
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('close');
|
756
|
+
if (id) {
|
757
|
+
triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'close');
|
758
|
+
} else {
|
759
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('close.zf.trigger');
|
760
|
+
}
|
761
|
+
},
|
762
|
+
toggleListener: function () {
|
763
|
+
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle');
|
764
|
+
if (id) {
|
765
|
+
triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'toggle');
|
766
|
+
} else {
|
767
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('toggle.zf.trigger');
|
768
|
+
}
|
769
|
+
},
|
770
|
+
closeableListener: function (e) {
|
771
|
+
e.stopPropagation();
|
772
|
+
var animation = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('closable');
|
773
|
+
|
774
|
+
if (animation !== '') {
|
775
|
+
__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["Motion"].animateOut(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), animation, function () {
|
776
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('closed.zf');
|
777
|
+
});
|
778
|
+
} else {
|
779
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).fadeOut().trigger('closed.zf');
|
780
|
+
}
|
781
|
+
},
|
782
|
+
toggleFocusListener: function () {
|
783
|
+
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle-focus');
|
784
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id).triggerHandler('toggle.zf.trigger', [__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)]);
|
785
|
+
}
|
786
|
+
};
|
787
|
+
|
788
|
+
// Elements with [data-open] will reveal a plugin that supports it when clicked.
|
789
|
+
Triggers.Initializers.addOpenListener = function ($elem) {
|
790
|
+
$elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);
|
791
|
+
$elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);
|
792
|
+
};
|
793
|
+
|
794
|
+
// Elements with [data-close] will close a plugin that supports it when clicked.
|
795
|
+
// If used without a value on [data-close], the event will bubble, allowing it to close a parent component.
|
796
|
+
Triggers.Initializers.addCloseListener = function ($elem) {
|
797
|
+
$elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);
|
798
|
+
$elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);
|
799
|
+
};
|
800
|
+
|
801
|
+
// Elements with [data-toggle] will toggle a plugin that supports it when clicked.
|
802
|
+
Triggers.Initializers.addToggleListener = function ($elem) {
|
803
|
+
$elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);
|
804
|
+
$elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);
|
805
|
+
};
|
806
|
+
|
807
|
+
// Elements with [data-closable] will respond to close.zf.trigger events.
|
808
|
+
Triggers.Initializers.addCloseableListener = function ($elem) {
|
809
|
+
$elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);
|
810
|
+
$elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);
|
811
|
+
};
|
812
|
+
|
813
|
+
// Elements with [data-toggle-focus] will respond to coming in and out of focus
|
814
|
+
Triggers.Initializers.addToggleFocusListener = function ($elem) {
|
815
|
+
$elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);
|
816
|
+
$elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);
|
817
|
+
};
|
818
|
+
|
819
|
+
// More Global/complex listeners and triggers
|
820
|
+
Triggers.Listeners.Global = {
|
821
|
+
resizeListener: function ($nodes) {
|
822
|
+
if (!MutationObserver) {
|
823
|
+
//fallback for IE 9
|
824
|
+
$nodes.each(function () {
|
825
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('resizeme.zf.trigger');
|
826
|
+
});
|
827
|
+
}
|
828
|
+
//trigger all listening elements and signal a resize event
|
829
|
+
$nodes.attr('data-events', "resize");
|
830
|
+
},
|
831
|
+
scrollListener: function ($nodes) {
|
832
|
+
if (!MutationObserver) {
|
833
|
+
//fallback for IE 9
|
834
|
+
$nodes.each(function () {
|
835
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('scrollme.zf.trigger');
|
836
|
+
});
|
837
|
+
}
|
838
|
+
//trigger all listening elements and signal a scroll event
|
839
|
+
$nodes.attr('data-events', "scroll");
|
840
|
+
},
|
841
|
+
closeMeListener: function (e, pluginId) {
|
842
|
+
var plugin = e.namespace.split('.')[0];
|
843
|
+
var plugins = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + plugin + ']').not('[data-yeti-box="' + pluginId + '"]');
|
844
|
+
|
845
|
+
plugins.each(function () {
|
846
|
+
var _this = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
847
|
+
_this.triggerHandler('close.zf.trigger', [_this]);
|
848
|
+
});
|
849
|
+
}
|
850
|
+
};
|
851
|
+
|
852
|
+
// Global, parses whole document.
|
853
|
+
Triggers.Initializers.addClosemeListener = function (pluginName) {
|
854
|
+
var yetiBoxes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-yeti-box]'),
|
855
|
+
plugNames = ['dropdown', 'tooltip', 'reveal'];
|
856
|
+
|
857
|
+
if (pluginName) {
|
858
|
+
if (typeof pluginName === 'string') {
|
859
|
+
plugNames.push(pluginName);
|
860
|
+
} else if (typeof pluginName === 'object' && typeof pluginName[0] === 'string') {
|
861
|
+
plugNames.concat(pluginName);
|
862
|
+
} else {
|
863
|
+
console.error('Plugin names must be strings');
|
864
|
+
}
|
865
|
+
}
|
866
|
+
if (yetiBoxes.length) {
|
867
|
+
var listeners = plugNames.map(function (name) {
|
868
|
+
return 'closeme.zf.' + name;
|
869
|
+
}).join(' ');
|
870
|
+
|
871
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);
|
872
|
+
}
|
873
|
+
};
|
874
|
+
|
875
|
+
function debounceGlobalListener(debounce, trigger, listener) {
|
876
|
+
var timer = void 0,
|
877
|
+
args = Array.prototype.slice.call(arguments, 3);
|
878
|
+
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(trigger).on(trigger, function (e) {
|
879
|
+
if (timer) {
|
880
|
+
clearTimeout(timer);
|
881
|
+
}
|
882
|
+
timer = setTimeout(function () {
|
883
|
+
listener.apply(null, args);
|
884
|
+
}, debounce || 10); //default time to emit scroll event
|
885
|
+
});
|
886
|
+
}
|
887
|
+
|
888
|
+
Triggers.Initializers.addResizeListener = function (debounce) {
|
889
|
+
var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-resize]');
|
890
|
+
if ($nodes.length) {
|
891
|
+
debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);
|
892
|
+
}
|
893
|
+
};
|
894
|
+
|
895
|
+
Triggers.Initializers.addScrollListener = function (debounce) {
|
896
|
+
var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-scroll]');
|
897
|
+
if ($nodes.length) {
|
898
|
+
debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);
|
899
|
+
}
|
900
|
+
};
|
901
|
+
|
902
|
+
Triggers.Initializers.addMutationEventsListener = function ($elem) {
|
903
|
+
if (!MutationObserver) {
|
904
|
+
return false;
|
905
|
+
}
|
906
|
+
var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');
|
907
|
+
|
908
|
+
//element callback
|
909
|
+
var listeningElementsMutation = function (mutationRecordsList) {
|
910
|
+
var $target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(mutationRecordsList[0].target);
|
911
|
+
|
912
|
+
//trigger the event handler for the element depending on type
|
913
|
+
switch (mutationRecordsList[0].type) {
|
914
|
+
case "attributes":
|
915
|
+
if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") {
|
916
|
+
$target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);
|
917
|
+
}
|
918
|
+
if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") {
|
919
|
+
$target.triggerHandler('resizeme.zf.trigger', [$target]);
|
920
|
+
}
|
921
|
+
if (mutationRecordsList[0].attributeName === "style") {
|
922
|
+
$target.closest("[data-mutate]").attr("data-events", "mutate");
|
923
|
+
$target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
|
924
|
+
}
|
925
|
+
break;
|
926
|
+
|
927
|
+
case "childList":
|
928
|
+
$target.closest("[data-mutate]").attr("data-events", "mutate");
|
929
|
+
$target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
|
930
|
+
break;
|
931
|
+
|
932
|
+
default:
|
933
|
+
return false;
|
934
|
+
//nothing
|
935
|
+
}
|
936
|
+
};
|
937
|
+
|
938
|
+
if ($nodes.length) {
|
939
|
+
//for each element that needs to listen for resizing, scrolling, or mutation add a single observer
|
940
|
+
for (var i = 0; i <= $nodes.length - 1; i++) {
|
941
|
+
var elementObserver = new MutationObserver(listeningElementsMutation);
|
942
|
+
elementObserver.observe($nodes[i], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: ["data-events", "style"] });
|
943
|
+
}
|
944
|
+
}
|
945
|
+
};
|
946
|
+
|
947
|
+
Triggers.Initializers.addSimpleListeners = function () {
|
948
|
+
var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document);
|
949
|
+
|
950
|
+
Triggers.Initializers.addOpenListener($document);
|
951
|
+
Triggers.Initializers.addCloseListener($document);
|
952
|
+
Triggers.Initializers.addToggleListener($document);
|
953
|
+
Triggers.Initializers.addCloseableListener($document);
|
954
|
+
Triggers.Initializers.addToggleFocusListener($document);
|
955
|
+
};
|
956
|
+
|
957
|
+
Triggers.Initializers.addGlobalListeners = function () {
|
958
|
+
var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document);
|
959
|
+
Triggers.Initializers.addMutationEventsListener($document);
|
960
|
+
Triggers.Initializers.addResizeListener();
|
961
|
+
Triggers.Initializers.addScrollListener();
|
962
|
+
Triggers.Initializers.addClosemeListener();
|
963
|
+
};
|
964
|
+
|
965
|
+
Triggers.init = function ($, Foundation) {
|
966
|
+
if (typeof $.triggersInitialized === 'undefined') {
|
967
|
+
var $document = $(document);
|
968
|
+
|
969
|
+
if (document.readyState === "complete") {
|
970
|
+
Triggers.Initializers.addSimpleListeners();
|
971
|
+
Triggers.Initializers.addGlobalListeners();
|
972
|
+
} else {
|
973
|
+
$(window).on('load', function () {
|
974
|
+
Triggers.Initializers.addSimpleListeners();
|
975
|
+
Triggers.Initializers.addGlobalListeners();
|
976
|
+
});
|
977
|
+
}
|
978
|
+
|
979
|
+
$.triggersInitialized = true;
|
980
|
+
}
|
981
|
+
|
982
|
+
if (Foundation) {
|
983
|
+
Foundation.Triggers = Triggers;
|
984
|
+
// Legacy included to be backwards compatible for now.
|
985
|
+
Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;
|
986
|
+
}
|
987
|
+
};
|
988
|
+
|
989
|
+
|
990
|
+
|
991
|
+
/***/ }),
|
992
|
+
|
993
|
+
/***/ 96:
|
994
|
+
/***/ (function(module, exports, __webpack_require__) {
|
995
|
+
|
996
|
+
module.exports = __webpack_require__(30);
|
997
|
+
|
998
|
+
|
999
|
+
/***/ })
|
1000
|
+
|
1001
|
+
/******/ });
|