Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
newPanel = this.panels[index];
DomHandler.fadeIn(newPanel, this.effectDuration);
if(this.showFilmstrip) {
let oldFrame = this.frames[this.activeIndex],
newFrame = this.frames[index];
if(reposition === undefined || reposition === true) {
let frameLeft = newFrame.offsetLeft,
stepFactor = this.frameWidth + parseInt(getComputedStyle(newFrame)['margin-right'], 10),
stripLeft = this.strip.offsetLeft,
frameViewportLeft = frameLeft + stripLeft,
frameViewportRight = frameViewportLeft + this.frameWidth;
if(frameViewportRight > DomHandler.width(this.stripWrapper))
this.stripLeft -= stepFactor;
else if(frameViewportLeft < 0)
this.stripLeft += stepFactor;
}
}
this.activeIndex = index;
this.onImageChange.emit({index: index});
}
}
render() {
this.panels = DomHandler.find(this.panelWrapper, 'li.ui-galleria-panel');
if(this.showFilmstrip) {
this.frames = DomHandler.find(this.strip,'li.ui-galleria-frame');
this.stripWrapper.style.width = DomHandler.width(this.panelWrapper) - 50 + 'px';
this.stripWrapper.style.height = this.frameHeight + 'px';
}
if(this.showCaption) {
this.caption = DomHandler.findSingle(this.container,'div.ui-galleria-caption');
this.caption.style.bottom = this.showFilmstrip ? DomHandler.getOuterHeight(this.stripWrapper,true) + 'px' : 0 + 'px';
this.caption.style.width = DomHandler.width(this.panelWrapper) + 'px';
}
if(this.autoPlay) {
this.startSlideshow();
}
this.container.style.visibility = 'visible';
}
render() {
this.panels = DomHandler.find(this.panelWrapper, 'li.ui-galleria-panel');
if(this.showFilmstrip) {
this.frames = DomHandler.find(this.strip,'li.ui-galleria-frame');
this.stripWrapper.style.width = DomHandler.width(this.panelWrapper) - 50 + 'px';
this.stripWrapper.style.height = this.frameHeight + 'px';
}
if(this.showCaption) {
this.caption = DomHandler.findSingle(this.container,'div.ui-galleria-caption');
this.caption.style.bottom = this.showFilmstrip ? DomHandler.getOuterHeight(this.stripWrapper,true) + 'px' : 0 + 'px';
this.caption.style.width = DomHandler.width(this.panelWrapper) + 'px';
}
if(this.autoPlay) {
this.startSlideshow();
}
this.container.style.visibility = 'visible';
}