()
| 335 | } |
| 336 | |
| 337 | constructor() { |
| 338 | super(); |
| 339 | |
| 340 | this._contentItemsObserver = new MutationObserver(() => { |
| 341 | const visibleItemsCount = this._visibleItems.length; |
| 342 | |
| 343 | if (this._visibleItemsCount === visibleItemsCount) { |
| 344 | return; |
| 345 | } |
| 346 | |
| 347 | this._visibleItemsCount = visibleItemsCount; |
| 348 | |
| 349 | this._currentPageIndex = clamp(this._currentPageIndex, 0, Math.max(0, this.items.length - this.effectiveItemsPerPage)); |
| 350 | this._focusedItemIndex = clamp(this._focusedItemIndex, this._currentPageIndex, this.items.length - 1); |
| 351 | this._changePageIndex(this._currentPageIndex, { fireEvent: false }); |
| 352 | }); |
| 353 | |
| 354 | this._scrollEnablement = new ScrollEnablement(this); |
| 355 | this._scrollEnablement.attachEvent("touchend", e => { |
| 356 | this._updateScrolling(e); |
| 357 | }); |
| 358 | this._onResizeBound = this._onResize.bind(this); |
| 359 | this._resizing = false; // indicates if the carousel is in process of resizing |
| 360 | |
| 361 | this._lastFocusedElements = []; |
| 362 | this._orderOfLastFocusedItems = []; |
| 363 | this._visibleItemsIndexes = []; |
| 364 | } |
| 365 | |
| 366 | onBeforeRendering() { |
| 367 | this._observeContentItems(); |
nothing calls this directly
no test coverage detected