@@ -21,7 +21,7 @@ const displaySIndicatorRoundel = (
21
21
const roundelElement =
22
22
document . getElementById ( overallRoundelElementId ) ??
23
23
( ( ) => {
24
- const newElem = document . createElement ( 'div ' ) ;
24
+ const newElem = document . createElement ( 'a ' ) ;
25
25
newElem . id = overallRoundelElementId ;
26
26
document . body . appendChild ( newElem ) ;
27
27
return newElem ;
@@ -45,6 +45,16 @@ const displaySIndicatorRoundel = (
45
45
roundelElement . style . width = '40px' ;
46
46
roundelElement . style . height = '40px' ;
47
47
48
+ roundelElement . style . cursor = 'pointer' ;
49
+ roundelElement . setAttribute (
50
+ 'href' ,
51
+ window . location . hostname === 'localhost'
52
+ ? 'http://localhost:4200/sIndicator'
53
+ : `https://syndication.${ window . location . hostname
54
+ . replace ( 'm.' , '' )
55
+ . replace ( 'www.' , '' ) } /sIndicator`,
56
+ ) ;
57
+
48
58
switch ( status ) {
49
59
case 'loading' :
50
60
roundelElement . title = 'Checking syndication status...' ;
@@ -66,15 +76,6 @@ const displaySIndicatorRoundel = (
66
76
'There was an error checking syndication status. Click to check your CAPI key...' ;
67
77
roundelElement . style . backgroundColor = 'yellow' ;
68
78
roundelElement . textContent = '⚠️' ;
69
- roundelElement . style . cursor = 'pointer' ;
70
- roundelElement . addEventListener (
71
- 'click' ,
72
- ( ) =>
73
- ( window . location . href =
74
- window . location . hostname === 'localhost'
75
- ? 'http://localhost:4200/sIndicator'
76
- : `https://syndication.${ window . location . hostname } /sIndicator` ) ,
77
- ) ;
78
79
break ;
79
80
}
80
81
} ;
0 commit comments