@@ -55,14 +55,15 @@ export class GithubCorners extends HTMLElement {
55
55
color ?: string ;
56
56
fill ?: string ;
57
57
position ?: string ;
58
+ target ?: string ;
58
59
top ?: string ;
59
60
left ?: string ;
60
61
right ?: string = '0' ;
61
62
bottom ?: string ;
62
63
transform ?: string ;
63
64
warpper ?: HTMLElement ;
64
65
static get observedAttributes ( ) : string [ ] {
65
- return [ 'z-index' , 'height' , 'width' , 'href' , 'color' , 'fill' , 'position' , 'top' , 'left' , 'right' , 'bottom' , 'transform' ] ;
66
+ return [ 'z-index' , 'target' , ' height', 'width' , 'href' , 'color' , 'fill' , 'position' , 'top' , 'left' , 'right' , 'bottom' , 'transform' ] ;
66
67
}
67
68
constructor ( ) {
68
69
super ( ) ;
@@ -73,18 +74,6 @@ export class GithubCorners extends HTMLElement {
73
74
shadow . appendChild ( this . ownerDocument . importNode ( TEMPLATE . content , true ) ) ;
74
75
this . warpper = shadow . getElementById ( 'warpper' ) ;
75
76
76
- // const svg = warpper.firstElementChild as SVGAElement;
77
- // console.log('>>>href', this.getAttributeNames())
78
- // console.log('>>>hre222f', warpper, warpper.querySelector('a'))
79
- // ;[...this.getAttributeNames(), 'right'].forEach((name) => {
80
- // if (/(z-index|height|width|color|fill|position|top|left|right|bottom|transform)/.test(name.toLocaleLowerCase())) {
81
- // svg.style[name as any] = this.getAttribute(name) || this[name as keyof GithubCorners] as any;
82
- // console.log('~~~', name, this['left'], this.getAttribute(name))
83
- // } else {
84
- // console.log('name::', name, this.getAttribute(name))
85
- // warpper.setAttribute(name, this.getAttribute(name));
86
- // }
87
- // });
88
77
this . update ( ) ;
89
78
}
90
79
update ( ) {
@@ -97,6 +86,9 @@ export class GithubCorners extends HTMLElement {
97
86
}
98
87
} ) ;
99
88
}
89
+ connectedCallback ( ) {
90
+ this . update ( )
91
+ }
100
92
attributeChangedCallback ( name : string , oldValue : string , newValue : string ) {
101
93
this . update ( )
102
94
}
0 commit comments