src/lib/myuw-app-bar/demo1.js
/**
        *   When component is first attached to the DOM,
        *   get its defined attributes and listen for
        *   scrolling
        */
When component is first attached to the DOM,
get its defined attributes and listen for
scrolling
When component is first attached to the DOM get its defined attributes and listen for scrolling
connectedCallback() {
            this['theme-name']      = this.getAttribute('theme-name');
            this['theme-url']       = this.getAttribute('theme-url');
            this['app-name']        = this.getAttribute('app-name');
            this['app-url']         = this.getAttribute('app-url');
            window.addEventListener('scroll', e => {
                if (window.scrollY !== 0) {
                    this.shadowRoot.getElementById('myuw-app-bar').classList.add('shadow');
                } else {
                    this.shadowRoot.getElementById('myuw-app-bar').classList.remove('shadow');
                }
            });
            this.updateComponent();
        }
connectedCallback ( ) { this [ 'theme-name' ] = this . getAttribute ( 'theme-name' ) ; this [ 'theme-url' ] = this . getAttribute ( 'theme-url' ) ; this [ 'app-name' ] = this . getAttribute ( 'app-name' ) ; this [ 'app-url' ] = this . getAttribute ( 'app-url' ) ; window . addEventListener ( 'scroll' , e => { if ( window . scrollY !== 0 ) { this . shadowRoot . getElementById ( 'myuw-app-bar' ) . classList . add ( 'shadow' ) ; } else { this . shadowRoot . getElementById ( 'myuw-app-bar' ) . classList . remove ( 'shadow' ) ; } } ) ; this . updateComponent ( ) ; }
When component is first attached to the DOM,
   get its defined attributes and listen for
   scrolling
When component is first attached to the DOM get its defined attributes and listen for scrolling
// Get all attributes // Attach scroll listener