Browse code

Refactor and rewrite as contao bundle

Benjamin Roth authored on04/11/2022 22:32:32
Showing1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,57 +0,0 @@
1
-"use strict";
2
-
3
-exports.__esModule = true;
4
-exports.getChangedParams = getChangedParams;
5
-
6
-var _paramsList = require("./params-list");
7
-
8
-var _utils = require("./utils");
9
-
10
-function getChangedParams(swiperParams, oldParams, children, oldChildren) {
11
-  var keys = [];
12
-  if (!oldParams) return keys;
13
-
14
-  var addKey = function addKey(key) {
15
-    if (keys.indexOf(key) < 0) keys.push(key);
16
-  };
17
-
18
-  var oldChildrenKeys = oldChildren.map(function (child) {
19
-    return child.key;
20
-  });
21
-  var childrenKeys = children.map(function (child) {
22
-    return child.key;
23
-  });
24
-  if (oldChildrenKeys.join('') !== childrenKeys.join('')) addKey('children');
25
-  if (oldChildren.length !== children.length) addKey('children');
26
-
27
-  var watchParams = _paramsList.paramsList.filter(function (key) {
28
-    return key[0] === '_';
29
-  }).map(function (key) {
30
-    return key.replace(/_/, '');
31
-  });
32
-
33
-  watchParams.forEach(function (key) {
34
-    if (key in swiperParams && key in oldParams) {
35
-      if ((0, _utils.isObject)(swiperParams[key]) && (0, _utils.isObject)(oldParams[key])) {
36
-        var newKeys = Object.keys(swiperParams[key]);
37
-        var oldKeys = Object.keys(oldParams[key]);
38
-
39
-        if (newKeys.length !== oldKeys.length) {
40
-          addKey(key);
41
-        } else {
42
-          newKeys.forEach(function (newKey) {
43
-            if (swiperParams[key][newKey] !== oldParams[key][newKey]) {
44
-              addKey(key);
45
-            }
46
-          });
47
-          oldKeys.forEach(function (oldKey) {
48
-            if (swiperParams[key][oldKey] !== oldParams[key][oldKey]) addKey(key);
49
-          });
50
-        }
51
-      } else if (swiperParams[key] !== oldParams[key]) {
52
-        addKey(key);
53
-      }
54
-    }
55
-  });
56
-  return keys;
57
-}
58 0
\ No newline at end of file
Browse code

swiper.js version 6.5.0

Benjamin Roth authored on14/03/2021 15:29:46
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,57 @@
1
+"use strict";
2
+
3
+exports.__esModule = true;
4
+exports.getChangedParams = getChangedParams;
5
+
6
+var _paramsList = require("./params-list");
7
+
8
+var _utils = require("./utils");
9
+
10
+function getChangedParams(swiperParams, oldParams, children, oldChildren) {
11
+  var keys = [];
12
+  if (!oldParams) return keys;
13
+
14
+  var addKey = function addKey(key) {
15
+    if (keys.indexOf(key) < 0) keys.push(key);
16
+  };
17
+
18
+  var oldChildrenKeys = oldChildren.map(function (child) {
19
+    return child.key;
20
+  });
21
+  var childrenKeys = children.map(function (child) {
22
+    return child.key;
23
+  });
24
+  if (oldChildrenKeys.join('') !== childrenKeys.join('')) addKey('children');
25
+  if (oldChildren.length !== children.length) addKey('children');
26
+
27
+  var watchParams = _paramsList.paramsList.filter(function (key) {
28
+    return key[0] === '_';
29
+  }).map(function (key) {
30
+    return key.replace(/_/, '');
31
+  });
32
+
33
+  watchParams.forEach(function (key) {
34
+    if (key in swiperParams && key in oldParams) {
35
+      if ((0, _utils.isObject)(swiperParams[key]) && (0, _utils.isObject)(oldParams[key])) {
36
+        var newKeys = Object.keys(swiperParams[key]);
37
+        var oldKeys = Object.keys(oldParams[key]);
38
+
39
+        if (newKeys.length !== oldKeys.length) {
40
+          addKey(key);
41
+        } else {
42
+          newKeys.forEach(function (newKey) {
43
+            if (swiperParams[key][newKey] !== oldParams[key][newKey]) {
44
+              addKey(key);
45
+            }
46
+          });
47
+          oldKeys.forEach(function (oldKey) {
48
+            if (swiperParams[key][oldKey] !== oldParams[key][oldKey]) addKey(key);
49
+          });
50
+        }
51
+      } else if (swiperParams[key] !== oldParams[key]) {
52
+        addKey(key);
53
+      }
54
+    }
55
+  });
56
+  return keys;
57
+}
0 58
\ No newline at end of file