1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory(require("./foundation.core"), require("./foundation.util.box"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("jquery"));
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define(["./foundation.core", "./foundation.util.box", "./foundation.util.mediaQuery", "./foundation.util.motion", "jquery"], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["foundation.tooltip"] = factory(require("./foundation.core"), require("./foundation.util.box"), require("./foundation.util.mediaQuery"), require("./foundation.util.motion"), require("jquery"));
|
8 | else
|
9 | root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.tooltip"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.box"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.mediaQuery"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["jQuery"]);
|
10 | })(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_box__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50 | }
|
51 | };
|
52 |
|
53 |
|
54 | __webpack_require__.r = function(exports) {
|
55 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57 | }
|
58 | Object.defineProperty(exports, '__esModule', { value: true });
|
59 | };
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | __webpack_require__.t = function(value, mode) {
|
67 | if(mode & 1) value = __webpack_require__(value);
|
68 | if(mode & 8) return value;
|
69 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70 | var ns = Object.create(null);
|
71 | __webpack_require__.r(ns);
|
72 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74 | return ns;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.n = function(module) {
|
79 | var getter = module && module.__esModule ?
|
80 | function getDefault() { return module['default']; } :
|
81 | function getModuleExports() { return module; };
|
82 | __webpack_require__.d(getter, 'a', getter);
|
83 | return getter;
|
84 | };
|
85 |
|
86 |
|
87 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88 |
|
89 |
|
90 | __webpack_require__.p = "";
|
91 |
|
92 |
|
93 |
|
94 | return __webpack_require__(__webpack_require__.s = 20);
|
95 | })
|
96 |
|
97 | ({
|
98 |
|
99 | "./foundation.core":
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | (function(module, exports) {
|
105 |
|
106 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;
|
107 |
|
108 | }),
|
109 |
|
110 | "./foundation.util.box":
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | (function(module, exports) {
|
116 |
|
117 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_box__;
|
118 |
|
119 | }),
|
120 |
|
121 | "./foundation.util.mediaQuery":
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | (function(module, exports) {
|
127 |
|
128 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__;
|
129 |
|
130 | }),
|
131 |
|
132 | "./foundation.util.motion":
|
133 |
|
134 |
|
135 |
|
136 |
|
137 | (function(module, exports) {
|
138 |
|
139 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__;
|
140 |
|
141 | }),
|
142 |
|
143 | "./js/entries/plugins/foundation.tooltip.js":
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | (function(module, __webpack_exports__, __webpack_require__) {
|
149 |
|
150 | "use strict";
|
151 | __webpack_require__.r(__webpack_exports__);
|
152 | var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./foundation.core");
|
153 | var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
|
154 | __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });
|
155 |
|
156 | var _foundation_tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./js/foundation.tooltip.js");
|
157 | __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _foundation_tooltip__WEBPACK_IMPORTED_MODULE_1__["Tooltip"]; });
|
158 |
|
159 |
|
160 |
|
161 | _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_tooltip__WEBPACK_IMPORTED_MODULE_1__["Tooltip"], 'Tooltip');
|
162 |
|
163 |
|
164 | }),
|
165 |
|
166 | "./js/foundation.positionable.js":
|
167 |
|
168 |
|
169 |
|
170 |
|
171 | (function(module, __webpack_exports__, __webpack_require__) {
|
172 |
|
173 | "use strict";
|
174 | __webpack_require__.r(__webpack_exports__);
|
175 | __webpack_require__.d(__webpack_exports__, "Positionable", function() { return Positionable; });
|
176 | var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./foundation.util.box");
|
177 | var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__);
|
178 | var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./foundation.core");
|
179 | var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__);
|
180 |
|
181 |
|
182 | function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
183 |
|
184 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
185 |
|
186 | 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); } }
|
187 |
|
188 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
189 |
|
190 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
191 |
|
192 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
193 |
|
194 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
195 |
|
196 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
197 |
|
198 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | var POSITIONS = ['left', 'right', 'top', 'bottom'];
|
204 | var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center'];
|
205 | var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center'];
|
206 | var ALIGNMENTS = {
|
207 | 'left': VERTICAL_ALIGNMENTS,
|
208 | 'right': VERTICAL_ALIGNMENTS,
|
209 | 'top': HORIZONTAL_ALIGNMENTS,
|
210 | 'bottom': HORIZONTAL_ALIGNMENTS
|
211 | };
|
212 |
|
213 | function nextItem(item, array) {
|
214 | var currentIdx = array.indexOf(item);
|
215 |
|
216 | if (currentIdx === array.length - 1) {
|
217 | return array[0];
|
218 | } else {
|
219 | return array[currentIdx + 1];
|
220 | }
|
221 | }
|
222 |
|
223 | var Positionable =
|
224 |
|
225 | function (_Plugin) {
|
226 | _inherits(Positionable, _Plugin);
|
227 |
|
228 | function Positionable() {
|
229 | _classCallCheck(this, Positionable);
|
230 |
|
231 | return _possibleConstructorReturn(this, _getPrototypeOf(Positionable).apply(this, arguments));
|
232 | }
|
233 |
|
234 | _createClass(Positionable, [{
|
235 | key: "_init",
|
236 |
|
237 | |
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 | value: function _init() {
|
247 | this.triedPositions = {};
|
248 | this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position;
|
249 | this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment;
|
250 | this.originalPosition = this.position;
|
251 | this.originalAlignment = this.alignment;
|
252 | }
|
253 | }, {
|
254 | key: "_getDefaultPosition",
|
255 | value: function _getDefaultPosition() {
|
256 | return 'bottom';
|
257 | }
|
258 | }, {
|
259 | key: "_getDefaultAlignment",
|
260 | value: function _getDefaultAlignment() {
|
261 | switch (this.position) {
|
262 | case 'bottom':
|
263 | case 'top':
|
264 | return Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["rtl"])() ? 'right' : 'left';
|
265 |
|
266 | case 'left':
|
267 | case 'right':
|
268 | return 'bottom';
|
269 | }
|
270 | }
|
271 | |
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 | }, {
|
279 | key: "_reposition",
|
280 | value: function _reposition() {
|
281 | if (this._alignmentsExhausted(this.position)) {
|
282 | this.position = nextItem(this.position, POSITIONS);
|
283 | this.alignment = ALIGNMENTS[this.position][0];
|
284 | } else {
|
285 | this._realign();
|
286 | }
|
287 | }
|
288 | |
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 | }, {
|
296 | key: "_realign",
|
297 | value: function _realign() {
|
298 | this._addTriedPosition(this.position, this.alignment);
|
299 |
|
300 | this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]);
|
301 | }
|
302 | }, {
|
303 | key: "_addTriedPosition",
|
304 | value: function _addTriedPosition(position, alignment) {
|
305 | this.triedPositions[position] = this.triedPositions[position] || [];
|
306 | this.triedPositions[position].push(alignment);
|
307 | }
|
308 | }, {
|
309 | key: "_positionsExhausted",
|
310 | value: function _positionsExhausted() {
|
311 | var isExhausted = true;
|
312 |
|
313 | for (var i = 0; i < POSITIONS.length; i++) {
|
314 | isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]);
|
315 | }
|
316 |
|
317 | return isExhausted;
|
318 | }
|
319 | }, {
|
320 | key: "_alignmentsExhausted",
|
321 | value: function _alignmentsExhausted(position) {
|
322 | return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length;
|
323 | }
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 | }, {
|
331 | key: "_getVOffset",
|
332 | value: function _getVOffset() {
|
333 | return this.options.vOffset;
|
334 | }
|
335 | }, {
|
336 | key: "_getHOffset",
|
337 | value: function _getHOffset() {
|
338 | return this.options.hOffset;
|
339 | }
|
340 | }, {
|
341 | key: "_setPosition",
|
342 | value: function _setPosition($anchor, $element, $parent) {
|
343 | if ($anchor.attr('aria-expanded') === 'false') {
|
344 | return false;
|
345 | }
|
346 |
|
347 | if (!this.options.allowOverlap) {
|
348 |
|
349 | this.position = this.originalPosition;
|
350 | this.alignment = this.originalAlignment;
|
351 | }
|
352 |
|
353 | $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
|
354 |
|
355 | if (!this.options.allowOverlap) {
|
356 | var minOverlap = 100000000;
|
357 |
|
358 | var minCoordinates = {
|
359 | position: this.position,
|
360 | alignment: this.alignment
|
361 | };
|
362 |
|
363 | while (!this._positionsExhausted()) {
|
364 | var overlap = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap);
|
365 |
|
366 | if (overlap === 0) {
|
367 | return;
|
368 | }
|
369 |
|
370 | if (overlap < minOverlap) {
|
371 | minOverlap = overlap;
|
372 | minCoordinates = {
|
373 | position: this.position,
|
374 | alignment: this.alignment
|
375 | };
|
376 | }
|
377 |
|
378 | this._reposition();
|
379 |
|
380 | $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
|
381 | }
|
382 |
|
383 |
|
384 |
|
385 | this.position = minCoordinates.position;
|
386 | this.alignment = minCoordinates.alignment;
|
387 | $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
|
388 | }
|
389 | }
|
390 | }]);
|
391 |
|
392 | return Positionable;
|
393 | }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
394 |
|
395 | Positionable.defaults = {
|
396 | |
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 | position: 'auto',
|
403 |
|
404 | |
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 | alignment: 'auto',
|
411 |
|
412 | |
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 | allowOverlap: false,
|
421 |
|
422 | |
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 | allowBottomOverlap: true,
|
431 |
|
432 | |
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 | vOffset: 0,
|
439 |
|
440 | |
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 | hOffset: 0
|
447 | };
|
448 |
|
449 |
|
450 | }),
|
451 |
|
452 | "./js/foundation.tooltip.js":
|
453 |
|
454 |
|
455 |
|
456 |
|
457 | (function(module, __webpack_exports__, __webpack_require__) {
|
458 |
|
459 | "use strict";
|
460 | __webpack_require__.r(__webpack_exports__);
|
461 | __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; });
|
462 | var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "jquery");
|
463 | var jquery__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
|
464 | var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./foundation.core");
|
465 | var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__);
|
466 | var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( "./foundation.util.mediaQuery");
|
467 | var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__);
|
468 | var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( "./js/foundation.util.triggers.js");
|
469 | var _foundation_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( "./js/foundation.positionable.js");
|
470 |
|
471 |
|
472 | function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
473 |
|
474 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
475 |
|
476 | 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); } }
|
477 |
|
478 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
479 |
|
480 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
481 |
|
482 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
483 |
|
484 | function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
485 |
|
486 | function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
487 |
|
488 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
489 |
|
490 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
491 |
|
492 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 | var Tooltip =
|
508 |
|
509 | function (_Positionable) {
|
510 | _inherits(Tooltip, _Positionable);
|
511 |
|
512 | function Tooltip() {
|
513 | _classCallCheck(this, Tooltip);
|
514 |
|
515 | return _possibleConstructorReturn(this, _getPrototypeOf(Tooltip).apply(this, arguments));
|
516 | }
|
517 |
|
518 | _createClass(Tooltip, [{
|
519 | key: "_setup",
|
520 |
|
521 | |
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 | value: function _setup(element, options) {
|
530 | this.$element = element;
|
531 | this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tooltip.defaults, this.$element.data(), options);
|
532 | this.className = 'Tooltip';
|
533 |
|
534 | this.isActive = false;
|
535 | this.isClick = false;
|
536 |
|
537 | _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
|
538 |
|
539 | this._init();
|
540 | }
|
541 | |
542 |
|
543 |
|
544 |
|
545 |
|
546 | }, {
|
547 | key: "_init",
|
548 | value: function _init() {
|
549 | _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init();
|
550 |
|
551 | var elemId = this.$element.attr('aria-describedby') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'tooltip');
|
552 | this.options.tipText = this.options.tipText || this.$element.attr('title');
|
553 | this.template = this.options.template ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.template) : this._buildTemplate(elemId);
|
554 |
|
555 | if (this.options.allowHtml) {
|
556 | this.template.appendTo(document.body).html(this.options.tipText).hide();
|
557 | } else {
|
558 | this.template.appendTo(document.body).text(this.options.tipText).hide();
|
559 | }
|
560 |
|
561 | this.$element.attr({
|
562 | 'title': '',
|
563 | 'aria-describedby': elemId,
|
564 | 'data-yeti-box': elemId,
|
565 | 'data-toggle': elemId,
|
566 | 'data-resize': elemId
|
567 | }).addClass(this.options.triggerClass);
|
568 |
|
569 | _get(_getPrototypeOf(Tooltip.prototype), "_init", this).call(this);
|
570 |
|
571 | this._events();
|
572 | }
|
573 | }, {
|
574 | key: "_getDefaultPosition",
|
575 | value: function _getDefaultPosition() {
|
576 |
|
577 | var elementClassName = this.$element[0].className;
|
578 |
|
579 | if (this.$element[0] instanceof SVGElement) {
|
580 | elementClassName = elementClassName.baseVal;
|
581 | }
|
582 |
|
583 | var position = elementClassName.match(/\b(top|left|right|bottom)\b/g);
|
584 | return position ? position[0] : 'top';
|
585 | }
|
586 | }, {
|
587 | key: "_getDefaultAlignment",
|
588 | value: function _getDefaultAlignment() {
|
589 | return 'center';
|
590 | }
|
591 | }, {
|
592 | key: "_getHOffset",
|
593 | value: function _getHOffset() {
|
594 | if (this.position === 'left' || this.position === 'right') {
|
595 | return this.options.hOffset + this.options.tooltipWidth;
|
596 | } else {
|
597 | return this.options.hOffset;
|
598 | }
|
599 | }
|
600 | }, {
|
601 | key: "_getVOffset",
|
602 | value: function _getVOffset() {
|
603 | if (this.position === 'top' || this.position === 'bottom') {
|
604 | return this.options.vOffset + this.options.tooltipHeight;
|
605 | } else {
|
606 | return this.options.vOffset;
|
607 | }
|
608 | }
|
609 | |
610 |
|
611 |
|
612 |
|
613 |
|
614 | }, {
|
615 | key: "_buildTemplate",
|
616 | value: function _buildTemplate(id) {
|
617 | var templateClasses = "".concat(this.options.tooltipClass, " ").concat(this.options.templateClasses).trim();
|
618 | var $template = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass(templateClasses).attr({
|
619 | 'role': 'tooltip',
|
620 | 'aria-hidden': true,
|
621 | 'data-is-active': false,
|
622 | 'data-is-focus': false,
|
623 | 'id': id
|
624 | });
|
625 | return $template;
|
626 | }
|
627 | |
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 | }, {
|
634 | key: "_setPosition",
|
635 | value: function _setPosition() {
|
636 | _get(_getPrototypeOf(Tooltip.prototype), "_setPosition", this).call(this, this.$element, this.template);
|
637 | }
|
638 | |
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 | }, {
|
646 | key: "show",
|
647 | value: function show() {
|
648 | if (this.options.showOn !== 'all' && !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.showOn)) {
|
649 |
|
650 | return false;
|
651 | }
|
652 |
|
653 | var _this = this;
|
654 |
|
655 | this.template.css('visibility', 'hidden').show();
|
656 |
|
657 | this._setPosition();
|
658 |
|
659 | this.template.removeClass('top bottom left right').addClass(this.position);
|
660 | this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);
|
661 | |
662 |
|
663 |
|
664 |
|
665 |
|
666 | this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));
|
667 | this.template.attr({
|
668 | 'data-is-active': true,
|
669 | 'aria-hidden': false
|
670 | });
|
671 | _this.isActive = true;
|
672 |
|
673 | this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () {
|
674 | });
|
675 | |
676 |
|
677 |
|
678 |
|
679 |
|
680 | this.$element.trigger('show.zf.tooltip');
|
681 | }
|
682 | |
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 | }, {
|
689 | key: "hide",
|
690 | value: function hide() {
|
691 |
|
692 | var _this = this;
|
693 |
|
694 | this.template.stop().attr({
|
695 | 'aria-hidden': true,
|
696 | 'data-is-active': false
|
697 | }).fadeOut(this.options.fadeOutDuration, function () {
|
698 | _this.isActive = false;
|
699 | _this.isClick = false;
|
700 | });
|
701 | |
702 |
|
703 |
|
704 |
|
705 |
|
706 | this.$element.trigger('hide.zf.tooltip');
|
707 | }
|
708 | |
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 | }, {
|
715 | key: "_events",
|
716 | value: function _events() {
|
717 | var _this = this;
|
718 |
|
719 | var hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined';
|
720 | var $template = this.template;
|
721 | var isFocus = false;
|
722 |
|
723 | if (hasTouch && this.options.disableForTouch) return;
|
724 |
|
725 | if (!this.options.disableHover) {
|
726 | this.$element.on('mouseenter.zf.tooltip', function (e) {
|
727 | if (!_this.isActive) {
|
728 | _this.timeout = setTimeout(function () {
|
729 | _this.show();
|
730 | }, _this.options.hoverDelay);
|
731 | }
|
732 | }).on('mouseleave.zf.tooltip', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function (e) {
|
733 | clearTimeout(_this.timeout);
|
734 |
|
735 | if (!isFocus || _this.isClick && !_this.options.clickOpen) {
|
736 | _this.hide();
|
737 | }
|
738 | }));
|
739 | }
|
740 |
|
741 | if (hasTouch) {
|
742 | this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function (e) {
|
743 | _this.isActive ? _this.hide() : _this.show();
|
744 | });
|
745 | }
|
746 |
|
747 | if (this.options.clickOpen) {
|
748 | this.$element.on('mousedown.zf.tooltip', function (e) {
|
749 | if (_this.isClick) {
|
750 |
|
751 | } else {
|
752 | _this.isClick = true;
|
753 |
|
754 | if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {
|
755 | _this.show();
|
756 | }
|
757 | }
|
758 | });
|
759 | } else {
|
760 | this.$element.on('mousedown.zf.tooltip', function (e) {
|
761 | _this.isClick = true;
|
762 | });
|
763 | }
|
764 |
|
765 | this.$element.on({
|
766 |
|
767 |
|
768 | 'close.zf.trigger': this.hide.bind(this)
|
769 | });
|
770 | this.$element.on('focus.zf.tooltip', function (e) {
|
771 | isFocus = true;
|
772 |
|
773 | if (_this.isClick) {
|
774 |
|
775 |
|
776 | if (!_this.options.clickOpen) {
|
777 | isFocus = false;
|
778 | }
|
779 |
|
780 | return false;
|
781 | } else {
|
782 | _this.show();
|
783 | }
|
784 | }).on('focusout.zf.tooltip', function (e) {
|
785 | isFocus = false;
|
786 | _this.isClick = false;
|
787 |
|
788 | _this.hide();
|
789 | }).on('resizeme.zf.trigger', function () {
|
790 | if (_this.isActive) {
|
791 | _this._setPosition();
|
792 | }
|
793 | });
|
794 | }
|
795 | |
796 |
|
797 |
|
798 |
|
799 |
|
800 | }, {
|
801 | key: "toggle",
|
802 | value: function toggle() {
|
803 | if (this.isActive) {
|
804 | this.hide();
|
805 | } else {
|
806 | this.show();
|
807 | }
|
808 | }
|
809 | |
810 |
|
811 |
|
812 |
|
813 |
|
814 | }, {
|
815 | key: "_destroy",
|
816 | value: function _destroy() {
|
817 | this.$element.attr('title', this.template.text()).off('.zf.trigger .zf.tooltip').removeClass(this.options.triggerClass).removeClass('top right left bottom').removeAttr('aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box');
|
818 | this.template.remove();
|
819 | }
|
820 | }]);
|
821 |
|
822 | return Tooltip;
|
823 | }(_foundation_positionable__WEBPACK_IMPORTED_MODULE_4__["Positionable"]);
|
824 |
|
825 | Tooltip.defaults = {
|
826 | |
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 | hoverDelay: 200,
|
833 |
|
834 | |
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 | fadeInDuration: 150,
|
841 |
|
842 | |
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 | fadeOutDuration: 150,
|
849 |
|
850 | |
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 | disableHover: false,
|
857 |
|
858 | |
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 | disableForTouch: false,
|
867 |
|
868 | |
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 | templateClasses: '',
|
875 |
|
876 | |
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 | tooltipClass: 'tooltip',
|
883 |
|
884 | |
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 | triggerClass: 'has-tip',
|
891 |
|
892 | |
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 | showOn: 'small',
|
899 |
|
900 | |
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 | template: '',
|
907 |
|
908 | |
909 |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 | tipText: '',
|
915 | touchCloseText: 'Tap to close.',
|
916 |
|
917 | |
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 | clickOpen: true,
|
924 |
|
925 | |
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 | position: 'auto',
|
932 |
|
933 | |
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 | alignment: 'auto',
|
940 |
|
941 | |
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 | allowOverlap: false,
|
949 |
|
950 | |
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 | allowBottomOverlap: false,
|
960 |
|
961 | |
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 | vOffset: 0,
|
968 |
|
969 | |
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 | hOffset: 0,
|
976 |
|
977 | |
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 | tooltipHeight: 14,
|
984 |
|
985 | |
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 | tooltipWidth: 12,
|
992 |
|
993 | |
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 | allowHtml: false
|
1001 | };
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 | }),
|
1009 |
|
1010 | "./js/foundation.util.triggers.js":
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 | (function(module, __webpack_exports__, __webpack_require__) {
|
1016 |
|
1017 | "use strict";
|
1018 | __webpack_require__.r(__webpack_exports__);
|
1019 | __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; });
|
1020 | var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "jquery");
|
1021 | var jquery__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
|
1022 | var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./foundation.core");
|
1023 | var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__);
|
1024 | var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( "./foundation.util.motion");
|
1025 | var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__);
|
1026 |
|
1027 |
|
1028 | function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 | var MutationObserver = function () {
|
1035 | var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
|
1036 |
|
1037 | for (var i = 0; i < prefixes.length; i++) {
|
1038 | if ("".concat(prefixes[i], "MutationObserver") in window) {
|
1039 | return window["".concat(prefixes[i], "MutationObserver")];
|
1040 | }
|
1041 | }
|
1042 |
|
1043 | return false;
|
1044 | }();
|
1045 |
|
1046 | var triggers = function triggers(el, type) {
|
1047 | el.data(type).split(' ').forEach(function (id) {
|
1048 | jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]);
|
1049 | });
|
1050 | };
|
1051 |
|
1052 | var Triggers = {
|
1053 | Listeners: {
|
1054 | Basic: {},
|
1055 | Global: {}
|
1056 | },
|
1057 | Initializers: {}
|
1058 | };
|
1059 | Triggers.Listeners.Basic = {
|
1060 | openListener: function openListener() {
|
1061 | triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open');
|
1062 | },
|
1063 | closeListener: function closeListener() {
|
1064 | var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close');
|
1065 |
|
1066 | if (id) {
|
1067 | triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close');
|
1068 | } else {
|
1069 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger');
|
1070 | }
|
1071 | },
|
1072 | toggleListener: function toggleListener() {
|
1073 | var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
|
1074 |
|
1075 | if (id) {
|
1076 | triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle');
|
1077 | } else {
|
1078 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger');
|
1079 | }
|
1080 | },
|
1081 | closeableListener: function closeableListener(e) {
|
1082 | var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable');
|
1083 |
|
1084 | e.stopPropagation();
|
1085 |
|
1086 | if (animation !== '') {
|
1087 | _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () {
|
1088 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf');
|
1089 | });
|
1090 | } else {
|
1091 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf');
|
1092 | }
|
1093 | },
|
1094 | toggleFocusListener: function toggleFocusListener() {
|
1095 | var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus');
|
1096 | jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)]);
|
1097 | }
|
1098 | };
|
1099 |
|
1100 | Triggers.Initializers.addOpenListener = function ($elem) {
|
1101 | $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);
|
1102 | $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);
|
1103 | };
|
1104 |
|
1105 |
|
1106 |
|
1107 | Triggers.Initializers.addCloseListener = function ($elem) {
|
1108 | $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);
|
1109 | $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);
|
1110 | };
|
1111 |
|
1112 |
|
1113 | Triggers.Initializers.addToggleListener = function ($elem) {
|
1114 | $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);
|
1115 | $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);
|
1116 | };
|
1117 |
|
1118 |
|
1119 | Triggers.Initializers.addCloseableListener = function ($elem) {
|
1120 | $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);
|
1121 | $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);
|
1122 | };
|
1123 |
|
1124 |
|
1125 | Triggers.Initializers.addToggleFocusListener = function ($elem) {
|
1126 | $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);
|
1127 | $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);
|
1128 | };
|
1129 |
|
1130 |
|
1131 | Triggers.Listeners.Global = {
|
1132 | resizeListener: function resizeListener($nodes) {
|
1133 | if (!MutationObserver) {
|
1134 |
|
1135 | $nodes.each(function () {
|
1136 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger');
|
1137 | });
|
1138 | }
|
1139 |
|
1140 |
|
1141 | $nodes.attr('data-events', "resize");
|
1142 | },
|
1143 | scrollListener: function scrollListener($nodes) {
|
1144 | if (!MutationObserver) {
|
1145 |
|
1146 | $nodes.each(function () {
|
1147 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger');
|
1148 | });
|
1149 | }
|
1150 |
|
1151 |
|
1152 | $nodes.attr('data-events', "scroll");
|
1153 | },
|
1154 | closeMeListener: function closeMeListener(e, pluginId) {
|
1155 | var plugin = e.namespace.split('.')[0];
|
1156 | var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]"));
|
1157 | plugins.each(function () {
|
1158 | var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
|
1159 |
|
1160 | _this.triggerHandler('close.zf.trigger', [_this]);
|
1161 | });
|
1162 | }
|
1163 |
|
1164 | };
|
1165 |
|
1166 | Triggers.Initializers.addClosemeListener = function (pluginName) {
|
1167 | var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-yeti-box]'),
|
1168 | plugNames = ['dropdown', 'tooltip', 'reveal'];
|
1169 |
|
1170 | if (pluginName) {
|
1171 | if (typeof pluginName === 'string') {
|
1172 | plugNames.push(pluginName);
|
1173 | } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') {
|
1174 | plugNames = plugNames.concat(pluginName);
|
1175 | } else {
|
1176 | console.error('Plugin names must be strings');
|
1177 | }
|
1178 | }
|
1179 |
|
1180 | if (yetiBoxes.length) {
|
1181 | var listeners = plugNames.map(function (name) {
|
1182 | return "closeme.zf.".concat(name);
|
1183 | }).join(' ');
|
1184 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);
|
1185 | }
|
1186 | };
|
1187 |
|
1188 | function debounceGlobalListener(debounce, trigger, listener) {
|
1189 | var timer,
|
1190 | args = Array.prototype.slice.call(arguments, 3);
|
1191 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(trigger).on(trigger, function (e) {
|
1192 | if (timer) {
|
1193 | clearTimeout(timer);
|
1194 | }
|
1195 |
|
1196 | timer = setTimeout(function () {
|
1197 | listener.apply(null, args);
|
1198 | }, debounce || 10);
|
1199 | });
|
1200 | }
|
1201 |
|
1202 | Triggers.Initializers.addResizeListener = function (debounce) {
|
1203 | var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]');
|
1204 |
|
1205 | if ($nodes.length) {
|
1206 | debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);
|
1207 | }
|
1208 | };
|
1209 |
|
1210 | Triggers.Initializers.addScrollListener = function (debounce) {
|
1211 | var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-scroll]');
|
1212 |
|
1213 | if ($nodes.length) {
|
1214 | debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);
|
1215 | }
|
1216 | };
|
1217 |
|
1218 | Triggers.Initializers.addMutationEventsListener = function ($elem) {
|
1219 | if (!MutationObserver) {
|
1220 | return false;
|
1221 | }
|
1222 |
|
1223 | var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');
|
1224 |
|
1225 | var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) {
|
1226 | var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(mutationRecordsList[0].target);
|
1227 |
|
1228 | switch (mutationRecordsList[0].type) {
|
1229 | case "attributes":
|
1230 | if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") {
|
1231 | $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);
|
1232 | }
|
1233 |
|
1234 | if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") {
|
1235 | $target.triggerHandler('resizeme.zf.trigger', [$target]);
|
1236 | }
|
1237 |
|
1238 | if (mutationRecordsList[0].attributeName === "style") {
|
1239 | $target.closest("[data-mutate]").attr("data-events", "mutate");
|
1240 | $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
|
1241 | }
|
1242 |
|
1243 | break;
|
1244 |
|
1245 | case "childList":
|
1246 | $target.closest("[data-mutate]").attr("data-events", "mutate");
|
1247 | $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
|
1248 | break;
|
1249 |
|
1250 | default:
|
1251 | return false;
|
1252 |
|
1253 | }
|
1254 | };
|
1255 |
|
1256 | if ($nodes.length) {
|
1257 |
|
1258 | for (var i = 0; i <= $nodes.length - 1; i++) {
|
1259 | var elementObserver = new MutationObserver(listeningElementsMutation);
|
1260 | elementObserver.observe($nodes[i], {
|
1261 | attributes: true,
|
1262 | childList: true,
|
1263 | characterData: false,
|
1264 | subtree: true,
|
1265 | attributeFilter: ["data-events", "style"]
|
1266 | });
|
1267 | }
|
1268 | }
|
1269 | };
|
1270 |
|
1271 | Triggers.Initializers.addSimpleListeners = function () {
|
1272 | var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
|
1273 | Triggers.Initializers.addOpenListener($document);
|
1274 | Triggers.Initializers.addCloseListener($document);
|
1275 | Triggers.Initializers.addToggleListener($document);
|
1276 | Triggers.Initializers.addCloseableListener($document);
|
1277 | Triggers.Initializers.addToggleFocusListener($document);
|
1278 | };
|
1279 |
|
1280 | Triggers.Initializers.addGlobalListeners = function () {
|
1281 | var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
|
1282 | Triggers.Initializers.addMutationEventsListener($document);
|
1283 | Triggers.Initializers.addResizeListener();
|
1284 | Triggers.Initializers.addScrollListener();
|
1285 | Triggers.Initializers.addClosemeListener();
|
1286 | };
|
1287 |
|
1288 | Triggers.init = function ($, Foundation) {
|
1289 | Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])($(window), function () {
|
1290 | if ($.triggersInitialized !== true) {
|
1291 | Triggers.Initializers.addSimpleListeners();
|
1292 | Triggers.Initializers.addGlobalListeners();
|
1293 | $.triggersInitialized = true;
|
1294 | }
|
1295 | });
|
1296 |
|
1297 | if (Foundation) {
|
1298 | Foundation.Triggers = Triggers;
|
1299 |
|
1300 | Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;
|
1301 | }
|
1302 | };
|
1303 |
|
1304 |
|
1305 |
|
1306 | }),
|
1307 |
|
1308 | 20:
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 | (function(module, exports, __webpack_require__) {
|
1314 |
|
1315 | module.exports = __webpack_require__("./js/entries/plugins/foundation.tooltip.js");
|
1316 |
|
1317 |
|
1318 | }),
|
1319 |
|
1320 | "jquery":
|
1321 |
|
1322 |
|
1323 |
|
1324 |
|
1325 | (function(module, exports) {
|
1326 |
|
1327 | module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
|
1328 |
|
1329 | })
|
1330 |
|
1331 | });
|
1332 | });
|
1333 |
|
\ | No newline at end of file |