File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -3,29 +3,30 @@ customElements.define('open-shadow',
33 constructor ( ) {
44 super ( ) ;
55
6- let pElem = document . createElement ( 'p' ) ;
6+ const pElem = document . createElement ( 'p' ) ;
77 pElem . textContent = this . getAttribute ( 'text' ) ;
88
9- let shadowRoot = this . attachShadow ( { mode : 'open' } )
10- . appendChild ( pElem ) ;
11-
9+ const shadowRoot = this . attachShadow ( { mode : 'open' } ) ;
10+ shadowRoot . appendChild ( pElem ) ;
11+ }
1212 }
13- } ) ;
13+ ) ;
1414
1515customElements . define ( 'closed-shadow' ,
1616 class extends HTMLElement {
1717 constructor ( ) {
1818 super ( ) ;
1919
20- let pElem = document . createElement ( 'p' ) ;
20+ const pElem = document . createElement ( 'p' ) ;
2121 pElem . textContent = this . getAttribute ( 'text' ) ;
2222
23- let shadowRoot = this . attachShadow ( { mode : 'closed' } )
24- . appendChild ( pElem ) ;
23+ const shadowRoot = this . attachShadow ( { mode : 'closed' } ) ;
24+ shadowRoot . appendChild ( pElem ) ;
25+ }
2526 }
26- } ) ;
27+ ) ;
2728
28- document . querySelector ( 'html' ) . addEventListener ( 'click' , function ( e ) {
29+ document . querySelector ( 'html' ) . addEventListener ( 'click' , e => {
2930 console . log ( e . composed ) ;
3031 console . log ( e . composedPath ( ) ) ;
3132} ) ;
You can’t perform that action at this time.
0 commit comments