MCPcopy Index your code
hub / github.com/UI5/webcomponents / constructor

Method constructor

packages/main/src/Carousel.ts:337–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 4

_changePageIndexMethod · 0.95
_updateScrollingMethod · 0.95
clampFunction · 0.85
attachEventMethod · 0.80

Tested by

no test coverage detected