Skip to content

Commit eb76d45

Browse files
authored
Merge pull request #365 from ezzak/fix_svgs_again
Fix SVGs again
2 parents bfba9cf + 096f612 commit eb76d45

File tree

5 files changed

+61
-25
lines changed

5 files changed

+61
-25
lines changed

src/css/popup.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ header {
8282
.menu_button,
8383
#close_button {
8484
cursor: pointer;
85+
display: flex;
8586
}
8687

8788
.state_boundary {

src/css/violations.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,10 @@ violation-list code {
142142
box-sizing: border-box;
143143
}
144144

145-
.download_img {
145+
.download_button {
146146
cursor: pointer;
147147
opacity: 0.8;
148-
width: 16px;
149-
height: 16px;
148+
display: inline-flex;
150149
}
151150

152151
violation-list .subtable_wrapper.expanded {

src/html/popup.html

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,37 +48,65 @@
4848
status-message="i18ndownloadSourceDescription"
4949
primary-button-id="i18nDownloadSourceButton"
5050
primary-button-action="download"></state-element>
51-
5251
<div class="state_boundary" id="menu">
5352
<header>
5453
<span class="header_title">
5554
<img src="default_32.png" width="20px" height="20px" />
5655
<p class="header_label" id="i18nTopLevel"></p>
5756
</span>
58-
<img id="close_button" height="20px" width="20px" src="x.svg" />
57+
<span id="close_button">
58+
<object
59+
height="20px"
60+
width="20px"
61+
type="image/svg+xml"
62+
data="x.svg" /></object>
63+
</span>
5964
</header>
60-
6165
<div class="menu_top_level">
6266
<div class="menu_right_sidebar">
6367
<div class="menu_row">
64-
<img src="circle-info.svg" height="20px" />
68+
<object
69+
type="image/svg+xml"
70+
data="circle-info.svg"
71+
height="20px"></object>
6572
<p id="i18nTopLevelLearnMore"></p>
66-
<img src="chevron-right.svg" height="16px" />
73+
<object
74+
type="image/svg+xml"
75+
data="chevron-right.svg"
76+
height="16px"></object>
6777
</div>
6878
<div class="menu_row">
69-
<img src="circle-info.svg" height="20px" />
79+
<object
80+
type="image/svg+xml"
81+
data="circle-info.svg"
82+
height="20px"></object>
7083
<p id="i18nViewAllViolations"></p>
71-
<img src="chevron-right.svg" height="16px" />
84+
<object
85+
type="image/svg+xml"
86+
data="chevron-right.svg"
87+
height="16px"></object>
7288
</div>
7389
<div class="menu_row">
74-
<img src="circle-download-cta.svg" height="20px" />
90+
<object
91+
type="image/svg+xml"
92+
data="circle-download-cta.svg"
93+
height="20px"></object>
7594
<p id="i18ndownloadSourcePrompt"></p>
76-
<img src="chevron-right.svg" height="16px" />
95+
<object
96+
type="image/svg+xml"
97+
data="chevron-right.svg"
98+
height="16px"></object>
7799
</div>
78100
<div class="menu_row">
79-
<img src="circle-download-cta.svg" height="20px" />
101+
<object
102+
type="image/svg+xml"
103+
data="circle-download-cta.svg"
104+
height="20px"></object>
80105
<p id="i18ndownloadReleaseSourcePrompt"></p>
81-
<img src="chevron-right.svg" height="16px" />
106+
<object
107+
type="image/svg+xml"
108+
data="chevron-right.svg"
109+
height="16px"></object>
82110
</div>
83111
</div>
84112
</div>

src/js/popup/popup.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,13 @@ class PopupHeader extends HTMLElement {
153153
: ''
154154
}
155155
</span>
156-
<img
157-
class="menu_button"
158-
height="20px"
159-
width="20px"
160-
src="menu-badge.svg" />
156+
<span class="menu_button">
157+
<object
158+
type="image/svg+xml"
159+
height="20px"
160+
width="20px"
161+
data="menu-badge.svg"></object>
162+
</span>
161163
</header>
162164
`;
163165

@@ -231,9 +233,10 @@ class StateElement extends HTMLElement {
231233
<div class="content_body">
232234
${
233235
type
234-
? `<img
236+
? `<object
235237
class="body_image"
236-
src="${type}-header.svg"/>`
238+
type="image/svg+xml"
239+
data="${type}-header.svg"></object>`
237240
: ''
238241
}
239242
${

src/js/popup/violation-list.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ class ViolationList extends HTMLElement {
3333
<td>${v.version}</td>
3434
<td>${v.origin}</td>
3535
<td>
36-
<img
37-
class="download_img"
36+
<span
3837
data-tab-id="${tabID}"
3938
data-hash="${v.hash}"
40-
src="circle-download-cta.svg"/>
39+
class="download_button">
40+
<object
41+
type="image/svg+xml"
42+
width="16px"
43+
height="16px"
44+
data="circle-download-cta.svg"></object>
45+
</span>
4146
</td>
4247
</tr>
4348
`;
@@ -100,7 +105,7 @@ class ViolationList extends HTMLElement {
100105
</table>
101106
`;
102107

103-
document.querySelectorAll('.download_img').forEach(img => {
108+
document.querySelectorAll('.download_button').forEach(img => {
104109
img.addEventListener('click', () => {
105110
const tabID = img.getAttribute('data-tab-id')!;
106111
const hash = img.getAttribute('data-hash')!;

0 commit comments

Comments
 (0)