1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports.initSwiper = initSwiper;
|
5 |
|
6 | var _core = _interopRequireDefault(require("../../core"));
|
7 |
|
8 | var _utils = require("./utils");
|
9 |
|
10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11 |
|
12 |
|
13 | function initSwiper(_ref, swiperParams) {
|
14 | var el = _ref.el,
|
15 | nextEl = _ref.nextEl,
|
16 | prevEl = _ref.prevEl,
|
17 | paginationEl = _ref.paginationEl,
|
18 | scrollbarEl = _ref.scrollbarEl;
|
19 |
|
20 | if ((0, _utils.needsNavigation)(swiperParams) && nextEl && prevEl) {
|
21 | if (swiperParams.navigation === true) {
|
22 | swiperParams.navigation = {};
|
23 | }
|
24 |
|
25 | swiperParams.navigation.nextEl = nextEl;
|
26 | swiperParams.navigation.prevEl = prevEl;
|
27 | }
|
28 |
|
29 | if ((0, _utils.needsPagination)(swiperParams) && paginationEl) {
|
30 | if (swiperParams.pagination === true) {
|
31 | swiperParams.pagination = {};
|
32 | }
|
33 |
|
34 | swiperParams.pagination.el = paginationEl;
|
35 | }
|
36 |
|
37 | if ((0, _utils.needsScrollbar)(swiperParams) && scrollbarEl) {
|
38 | if (swiperParams.scrollbar === true) {
|
39 | swiperParams.scrollbar = {};
|
40 | }
|
41 |
|
42 | swiperParams.scrollbar.el = scrollbarEl;
|
43 | }
|
44 |
|
45 | return new _core.default(el, swiperParams);
|
46 | } |
\ | No newline at end of file |