How to use the primeng/dom.DomHandler.width function in primeng

To help you get started, we’ve selected a few primeng examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github primefaces / primeng / src / app / components / galleria / galleria.ts View on Github external
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});
        }
    }
github primefaces / primeng / src / app / components / galleria / galleria.ts View on Github external
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';
    }
github primefaces / primeng / src / app / components / galleria / galleria.ts View on Github external
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';
    }