@madj2k/fe-frontend-kit 2.0.14 → 2.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madj2k/fe-frontend-kit",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "Shared frontend utilities, menus and mixins for projects",
5
5
  "main": "index.js",
6
6
  "style": "index.scss",
@@ -22,7 +22,11 @@
22
22
  * @see https://www.gnu.org/licenses/gpl-3.0.en.html
23
23
  *
24
24
  * @example:
25
- * const owlThumbnail = new Madj2kOwlThumbnail('.js-main-carousel', '.js-thumbs-carousel', {
25
+ * $('.js-highlight-slider-container').each(function () {
26
+ * const owlThumbnail = new Madj2kOwlThumbnail(
27
+ * '.js-main-carousel',
28
+ * '.js-thumbs-carousel',
29
+ * {
26
30
  * main: {
27
31
  * items: 1,
28
32
  * margin: 20,
@@ -40,7 +44,9 @@
40
44
  * resizeEvent: 'custom.resize',
41
45
  * equalizeThumbHeights: true,
42
46
  * noStageOffset: true
43
- * }
47
+ * },
48
+ * false,
49
+ * this
44
50
  * });
45
51
  * HTML example without data attributes:
46
52
  * <div class="js-main-carousel owl-carousel">
@@ -68,10 +74,20 @@
68
74
  *
69
75
  */
70
76
  class Madj2kOwlThumbnail {
71
- constructor(mainSelector, thumbSelector, options = {}, debug = false) {
77
+ /**
78
+ * Creates a new OwlThumbnail instance
79
+ * @param {string} mainSelector - CSS selector for main carousel element
80
+ * @param {string} thumbSelector - CSS selector for thumbnail carousel element
81
+ * @param {Object} options - Configuration options
82
+ * @param {boolean} debug - Enables debug logging
83
+ * @param {Document} container - DOM container to use for event listeners
84
+ */
85
+ constructor(mainSelector, thumbSelector, options = {}, debug = false, container = document) {
72
86
  this.debug = debug;
73
- this.$main = $(mainSelector);
74
- this.$thumbs = $(thumbSelector);
87
+
88
+ this.$context = $(container);
89
+ this.$main = this.$context.find(mainSelector);
90
+ this.$thumbs = this.$context.find(thumbSelector);
75
91
  this.options = options;
76
92
  this.syncing = false;
77
93