1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.keyboard"), require("./foundation.util.motion"), require("./foundation.util.timer"), require("./foundation.util.touch"), require("jquery"));
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define(["./foundation.core", "./foundation.util.imageLoader", "./foundation.util.keyboard", "./foundation.util.motion", "./foundation.util.timer", "./foundation.util.touch", "jquery"], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["foundation.orbit"] = factory(require("./foundation.core"), require("./foundation.util.imageLoader"), require("./foundation.util.keyboard"), require("./foundation.util.motion"), require("./foundation.util.timer"), require("./foundation.util.touch"), require("jquery"));
|
8 | else
|
9 | root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.orbit"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.imageLoader"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.motion"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.timer"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.touch"], root["jQuery"]);
|
10 | })(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __WEBPACK_EXTERNAL_MODULE__foundation_util_timer__, __WEBPACK_EXTERNAL_MODULE__foundation_util_touch__, __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 = 10);
|
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.imageLoader":
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | (function(module, exports) {
|
116 |
|
117 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_imageLoader__;
|
118 |
|
119 | }),
|
120 |
|
121 | "./foundation.util.keyboard":
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | (function(module, exports) {
|
127 |
|
128 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__;
|
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 | "./foundation.util.timer":
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | (function(module, exports) {
|
149 |
|
150 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_timer__;
|
151 |
|
152 | }),
|
153 |
|
154 | "./foundation.util.touch":
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | (function(module, exports) {
|
160 |
|
161 | module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_touch__;
|
162 |
|
163 | }),
|
164 |
|
165 | "./js/entries/plugins/foundation.orbit.js":
|
166 |
|
167 |
|
168 |
|
169 |
|
170 | (function(module, __webpack_exports__, __webpack_require__) {
|
171 |
|
172 | "use strict";
|
173 | __webpack_require__.r(__webpack_exports__);
|
174 | var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./foundation.core");
|
175 | var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
|
176 | __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });
|
177 |
|
178 | var _foundation_orbit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./js/foundation.orbit.js");
|
179 | __webpack_require__.d(__webpack_exports__, "Orbit", function() { return _foundation_orbit__WEBPACK_IMPORTED_MODULE_1__["Orbit"]; });
|
180 |
|
181 |
|
182 |
|
183 | _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_orbit__WEBPACK_IMPORTED_MODULE_1__["Orbit"], 'Orbit');
|
184 |
|
185 |
|
186 | }),
|
187 |
|
188 | "./js/foundation.orbit.js":
|
189 |
|
190 |
|
191 |
|
192 |
|
193 | (function(module, __webpack_exports__, __webpack_require__) {
|
194 |
|
195 | "use strict";
|
196 | __webpack_require__.r(__webpack_exports__);
|
197 | __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; });
|
198 | var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "jquery");
|
199 | var jquery__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
|
200 | var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./foundation.util.keyboard");
|
201 | var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__);
|
202 | var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( "./foundation.util.motion");
|
203 | var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__);
|
204 | var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( "./foundation.util.timer");
|
205 | var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__);
|
206 | var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( "./foundation.util.imageLoader");
|
207 | var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__);
|
208 | var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( "./foundation.core");
|
209 | var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__);
|
210 | var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( "./foundation.util.touch");
|
211 | var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(_foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__);
|
212 |
|
213 |
|
214 | 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); }
|
215 |
|
216 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
217 |
|
218 | 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); } }
|
219 |
|
220 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
221 |
|
222 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
223 |
|
224 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
225 |
|
226 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
227 |
|
228 | 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); }
|
229 |
|
230 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 | var Orbit =
|
251 |
|
252 | function (_Plugin) {
|
253 | _inherits(Orbit, _Plugin);
|
254 |
|
255 | function Orbit() {
|
256 | _classCallCheck(this, Orbit);
|
257 |
|
258 | return _possibleConstructorReturn(this, _getPrototypeOf(Orbit).apply(this, arguments));
|
259 | }
|
260 |
|
261 | _createClass(Orbit, [{
|
262 | key: "_setup",
|
263 |
|
264 | |
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 | value: function _setup(element, options) {
|
272 | this.$element = element;
|
273 | this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options);
|
274 | this.className = 'Orbit';
|
275 |
|
276 | _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
|
277 |
|
278 | this._init();
|
279 |
|
280 | _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', {
|
281 | 'ltr': {
|
282 | 'ARROW_RIGHT': 'next',
|
283 | 'ARROW_LEFT': 'previous'
|
284 | },
|
285 | 'rtl': {
|
286 | 'ARROW_LEFT': 'next',
|
287 | 'ARROW_RIGHT': 'previous'
|
288 | }
|
289 | });
|
290 | }
|
291 | |
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 | }, {
|
298 | key: "_init",
|
299 | value: function _init() {
|
300 |
|
301 | this._reset();
|
302 |
|
303 | this.$wrapper = this.$element.find(".".concat(this.options.containerClass));
|
304 | this.$slides = this.$element.find(".".concat(this.options.slideClass));
|
305 | var $images = this.$element.find('img'),
|
306 | initActive = this.$slides.filter('.is-active'),
|
307 | id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit');
|
308 | this.$element.attr({
|
309 | 'data-resize': id,
|
310 | 'id': id
|
311 | });
|
312 |
|
313 | if (!initActive.length) {
|
314 | this.$slides.eq(0).addClass('is-active');
|
315 | }
|
316 |
|
317 | if (!this.options.useMUI) {
|
318 | this.$slides.addClass('no-motionui');
|
319 | }
|
320 |
|
321 | if ($images.length) {
|
322 | Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this));
|
323 | } else {
|
324 | this._prepareForOrbit();
|
325 |
|
326 | }
|
327 |
|
328 | if (this.options.bullets) {
|
329 | this._loadBullets();
|
330 | }
|
331 |
|
332 | this._events();
|
333 |
|
334 | if (this.options.autoPlay && this.$slides.length > 1) {
|
335 | this.geoSync();
|
336 | }
|
337 |
|
338 | if (this.options.accessible) {
|
339 |
|
340 | this.$wrapper.attr('tabindex', 0);
|
341 | }
|
342 | }
|
343 | |
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 | }, {
|
350 | key: "_loadBullets",
|
351 | value: function _loadBullets() {
|
352 | this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button');
|
353 | }
|
354 | |
355 |
|
356 |
|
357 |
|
358 |
|
359 | }, {
|
360 | key: "geoSync",
|
361 | value: function geoSync() {
|
362 | var _this = this;
|
363 |
|
364 | this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, {
|
365 | duration: this.options.timerDelay,
|
366 | infinite: false
|
367 | }, function () {
|
368 | _this.changeSlide(true);
|
369 | });
|
370 | this.timer.start();
|
371 | }
|
372 | |
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 | }, {
|
379 | key: "_prepareForOrbit",
|
380 | value: function _prepareForOrbit() {
|
381 | var _this = this;
|
382 |
|
383 | this._setWrapperHeight();
|
384 | }
|
385 | |
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | }, {
|
393 | key: "_setWrapperHeight",
|
394 | value: function _setWrapperHeight(cb) {
|
395 |
|
396 | var max = 0,
|
397 | temp,
|
398 | counter = 0,
|
399 | _this = this;
|
400 |
|
401 | this.$slides.each(function () {
|
402 | temp = this.getBoundingClientRect().height;
|
403 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-slide', counter);
|
404 |
|
405 | if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
|
406 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({
|
407 | 'display': 'none'
|
408 | });
|
409 | }
|
410 |
|
411 | max = temp > max ? temp : max;
|
412 | counter++;
|
413 | });
|
414 |
|
415 | if (counter === this.$slides.length) {
|
416 | this.$wrapper.css({
|
417 | 'height': max
|
418 | });
|
419 |
|
420 | if (cb) {
|
421 | cb(max);
|
422 | }
|
423 |
|
424 | }
|
425 | }
|
426 | |
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | }, {
|
433 | key: "_setSlideHeight",
|
434 | value: function _setSlideHeight(height) {
|
435 | this.$slides.each(function () {
|
436 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height);
|
437 | });
|
438 | }
|
439 | |
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | }, {
|
446 | key: "_events",
|
447 | value: function _events() {
|
448 | var _this = this;
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 | this.$element.off('.resizeme.zf.trigger').on({
|
456 | 'resizeme.zf.trigger': this._prepareForOrbit.bind(this)
|
457 | });
|
458 |
|
459 | if (this.$slides.length > 1) {
|
460 | if (this.options.swipe) {
|
461 | this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) {
|
462 | e.preventDefault();
|
463 |
|
464 | _this.changeSlide(true);
|
465 | }).on('swiperight.zf.orbit', function (e) {
|
466 | e.preventDefault();
|
467 |
|
468 | _this.changeSlide(false);
|
469 | });
|
470 | }
|
471 |
|
472 |
|
473 | if (this.options.autoPlay) {
|
474 | this.$slides.on('click.zf.orbit', function () {
|
475 | _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);
|
476 |
|
477 | _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();
|
478 | });
|
479 |
|
480 | if (this.options.pauseOnHover) {
|
481 | this.$element.on('mouseenter.zf.orbit', function () {
|
482 | _this.timer.pause();
|
483 | }).on('mouseleave.zf.orbit', function () {
|
484 | if (!_this.$element.data('clickedOn')) {
|
485 | _this.timer.start();
|
486 | }
|
487 | });
|
488 | }
|
489 | }
|
490 |
|
491 | if (this.options.navButtons) {
|
492 | var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass));
|
493 | $controls.attr('tabindex', 0)
|
494 | .on('click.zf.orbit touchend.zf.orbit', function (e) {
|
495 | e.preventDefault();
|
496 |
|
497 | _this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass));
|
498 | });
|
499 | }
|
500 |
|
501 | if (this.options.bullets) {
|
502 | this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () {
|
503 | if (/is-active/g.test(this.className)) {
|
504 | return false;
|
505 | }
|
506 |
|
507 |
|
508 | var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'),
|
509 | ltr = idx > _this.$slides.filter('.is-active').data('slide'),
|
510 | $slide = _this.$slides.eq(idx);
|
511 |
|
512 | _this.changeSlide(ltr, $slide, idx);
|
513 | });
|
514 | }
|
515 |
|
516 | if (this.options.accessible) {
|
517 | this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) {
|
518 |
|
519 | _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', {
|
520 | next: function next() {
|
521 | _this.changeSlide(true);
|
522 | },
|
523 | previous: function previous() {
|
524 | _this.changeSlide(false);
|
525 | },
|
526 | handled: function handled() {
|
527 |
|
528 | if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) {
|
529 | _this.$bullets.filter('.is-active').focus();
|
530 | }
|
531 | }
|
532 | });
|
533 | });
|
534 | }
|
535 | }
|
536 | }
|
537 | |
538 |
|
539 |
|
540 |
|
541 | }, {
|
542 | key: "_reset",
|
543 | value: function _reset() {
|
544 |
|
545 | if (typeof this.$slides == 'undefined') {
|
546 | return;
|
547 | }
|
548 |
|
549 | if (this.$slides.length > 1) {
|
550 |
|
551 | this.$element.off('.zf.orbit').find('*').off('.zf.orbit');
|
552 |
|
553 | if (this.options.autoPlay) {
|
554 | this.timer.restart();
|
555 | }
|
556 |
|
557 |
|
558 | this.$slides.each(function (el) {
|
559 | jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide();
|
560 | });
|
561 |
|
562 | this.$slides.first().addClass('is-active').show();
|
563 |
|
564 | this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]);
|
565 |
|
566 | if (this.options.bullets) {
|
567 | this._updateBullets(0);
|
568 | }
|
569 | }
|
570 | }
|
571 | |
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 | }, {
|
581 | key: "changeSlide",
|
582 | value: function changeSlide(isLTR, chosenSlide, idx) {
|
583 | if (!this.$slides) {
|
584 | return;
|
585 | }
|
586 |
|
587 |
|
588 | var $curSlide = this.$slides.filter('.is-active').eq(0);
|
589 |
|
590 | if (/mui/g.test($curSlide[0].className)) {
|
591 | return false;
|
592 | }
|
593 |
|
594 |
|
595 | var $firstSlide = this.$slides.first(),
|
596 | $lastSlide = this.$slides.last(),
|
597 | dirIn = isLTR ? 'Right' : 'Left',
|
598 | dirOut = isLTR ? 'Left' : 'Right',
|
599 | _this = this,
|
600 | $newSlide;
|
601 |
|
602 | if (!chosenSlide) {
|
603 |
|
604 | $newSlide = isLTR ?
|
605 | this.options.infiniteWrap ? $curSlide.next(".".concat(this.options.slideClass)).length ? $curSlide.next(".".concat(this.options.slideClass)) : $firstSlide : $curSlide.next(".".concat(this.options.slideClass)) :
|
606 | this.options.infiniteWrap ? $curSlide.prev(".".concat(this.options.slideClass)).length ? $curSlide.prev(".".concat(this.options.slideClass)) : $lastSlide : $curSlide.prev(".".concat(this.options.slideClass));
|
607 | } else {
|
608 | $newSlide = chosenSlide;
|
609 | }
|
610 |
|
611 | if ($newSlide.length) {
|
612 | |
613 |
|
614 |
|
615 |
|
616 | this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
|
617 |
|
618 | if (this.options.bullets) {
|
619 | idx = idx || this.$slides.index($newSlide);
|
620 |
|
621 | this._updateBullets(idx);
|
622 | }
|
623 |
|
624 | if (this.options.useMUI && !this.$element.is(':hidden')) {
|
625 | _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () {
|
626 | $newSlide.css({
|
627 | 'display': 'block'
|
628 | }).attr('aria-live', 'polite');
|
629 | });
|
630 | _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () {
|
631 | $curSlide.removeAttr('aria-live');
|
632 |
|
633 | if (_this.options.autoPlay && !_this.timer.isPaused) {
|
634 | _this.timer.restart();
|
635 | }
|
636 |
|
637 | });
|
638 | } else {
|
639 | $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();
|
640 | $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();
|
641 |
|
642 | if (this.options.autoPlay && !this.timer.isPaused) {
|
643 | this.timer.restart();
|
644 | }
|
645 | }
|
646 | |
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 | this.$element.trigger('slidechange.zf.orbit', [$newSlide]);
|
653 | }
|
654 | }
|
655 | |
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 | }, {
|
666 | key: "_updateBullets",
|
667 | value: function _updateBullets(idx) {
|
668 | var $oldBullet = this.$bullets.filter('.is-active');
|
669 | var $othersBullets = this.$bullets.not('.is-active');
|
670 | var $newBullet = this.$bullets.eq(idx);
|
671 | $oldBullet.removeClass('is-active').blur();
|
672 | $newBullet.addClass('is-active');
|
673 |
|
674 | var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last();
|
675 |
|
676 | if (!activeStateDescriptor.length) {
|
677 | var spans = $oldBullet.children('span');
|
678 | var spanCountInOthersBullets = $othersBullets.toArray().map(function (b) {
|
679 | return jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).children('span').length;
|
680 | });
|
681 |
|
682 | if (spanCountInOthersBullets.every(function (count) {
|
683 | return count < spans.length;
|
684 | })) {
|
685 | activeStateDescriptor = spans.last();
|
686 | activeStateDescriptor.attr('data-slide-active-label', '');
|
687 | }
|
688 | }
|
689 |
|
690 |
|
691 | if (activeStateDescriptor.length) {
|
692 | activeStateDescriptor.detach();
|
693 | $newBullet.append(activeStateDescriptor);
|
694 | }
|
695 | }
|
696 | |
697 |
|
698 |
|
699 |
|
700 |
|
701 | }, {
|
702 | key: "_destroy",
|
703 | value: function _destroy() {
|
704 | this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
|
705 | }
|
706 | }]);
|
707 |
|
708 | return Orbit;
|
709 | }(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["Plugin"]);
|
710 |
|
711 | Orbit.defaults = {
|
712 | |
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 | bullets: true,
|
719 |
|
720 | |
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 | navButtons: true,
|
727 |
|
728 | |
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 | animInFromRight: 'slide-in-right',
|
735 |
|
736 | |
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 | animOutToRight: 'slide-out-right',
|
743 |
|
744 | |
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 | animInFromLeft: 'slide-in-left',
|
752 |
|
753 | |
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 | animOutToLeft: 'slide-out-left',
|
760 |
|
761 | |
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 | autoPlay: true,
|
768 |
|
769 | |
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 | timerDelay: 5000,
|
776 |
|
777 | |
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | infiniteWrap: true,
|
784 |
|
785 | |
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 | swipe: true,
|
792 |
|
793 | |
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 | pauseOnHover: true,
|
800 |
|
801 | |
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 | accessible: true,
|
808 |
|
809 | |
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 | containerClass: 'orbit-container',
|
816 |
|
817 | |
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 | slideClass: 'orbit-slide',
|
824 |
|
825 | |
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 | boxOfBullets: 'orbit-bullets',
|
832 |
|
833 | |
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 | nextClass: 'orbit-next',
|
840 |
|
841 | |
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 | prevClass: 'orbit-previous',
|
848 |
|
849 | |
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 | useMUI: true
|
856 | };
|
857 |
|
858 |
|
859 | }),
|
860 |
|
861 | 10:
|
862 |
|
863 |
|
864 |
|
865 |
|
866 | (function(module, exports, __webpack_require__) {
|
867 |
|
868 | module.exports = __webpack_require__("./js/entries/plugins/foundation.orbit.js");
|
869 |
|
870 |
|
871 | }),
|
872 |
|
873 | "jquery":
|
874 |
|
875 |
|
876 |
|
877 |
|
878 | (function(module, exports) {
|
879 |
|
880 | module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
|
881 |
|
882 | })
|
883 |
|
884 | });
|
885 | });
|
886 |
|
\ | No newline at end of file |