Expose extension file size on site download button

This commit is contained in:
hensm
2020-09-09 16:02:01 +01:00
parent b26be541b6
commit 2364914a76
2 changed files with 4 additions and 4 deletions

View File

@@ -193,8 +193,8 @@ h1.site-header__title {
color: var(--blue-60); color: var(--blue-60);
} }
.app-list__app:not(.button)[data-app-size]::after { .app-list__app:not(.button)[data-file-size]::after {
content: "(" attr(data-app-size) ")"; content: "(" attr(data-file-size) ")";
display: block; display: block;
position: absolute; position: absolute;
right: 0; right: 0;

View File

@@ -83,7 +83,7 @@ switch (navigator.platform) {
function populateAppListApp (element, fileUrl, fileName, fileSize) { function populateAppListApp (element, fileUrl, fileName, fileSize) {
element.href = fileUrl; element.href = fileUrl;
element.title = `${fileName} (${fileSize})`; element.title = `${fileName} (${fileSize})`;
element.dataset.appSize = fileSize; element.dataset.fileSize = fileSize;
element.removeAttribute("disabled"); element.removeAttribute("disabled");
} }
@@ -105,9 +105,9 @@ function onResponse (res) {
switch (asset.name.match(REGEX_EXT).pop()) { switch (asset.name.match(REGEX_EXT).pop()) {
case "xpi": case "xpi":
downloadExtBtn.href = asset.browser_download_url; downloadExtBtn.href = asset.browser_download_url;
downloadExtBtn.title = `${asset.name} (${formattedSize})`;
downloadExtBtn.dataset.version = res.tag_name; downloadExtBtn.dataset.version = res.tag_name;
downloadExtBtn.removeAttribute("disabled"); downloadExtBtn.removeAttribute("disabled");
downloadExtBtn.removeAttribute("title");
break; break;