From 2364914a768c47e44338dfaaa397e5ab1c8b555d Mon Sep 17 00:00:00 2001 From: hensm Date: Wed, 9 Sep 2020 16:02:01 +0100 Subject: [PATCH] Expose extension file size on site download button --- docs/index.css | 4 ++-- docs/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.css b/docs/index.css index ae30a54..d0454cd 100755 --- a/docs/index.css +++ b/docs/index.css @@ -193,8 +193,8 @@ h1.site-header__title { color: var(--blue-60); } -.app-list__app:not(.button)[data-app-size]::after { - content: "(" attr(data-app-size) ")"; +.app-list__app:not(.button)[data-file-size]::after { + content: "(" attr(data-file-size) ")"; display: block; position: absolute; right: 0; diff --git a/docs/index.js b/docs/index.js index 0e7eb94..ea2d770 100644 --- a/docs/index.js +++ b/docs/index.js @@ -83,7 +83,7 @@ switch (navigator.platform) { function populateAppListApp (element, fileUrl, fileName, fileSize) { element.href = fileUrl; element.title = `${fileName} (${fileSize})`; - element.dataset.appSize = fileSize; + element.dataset.fileSize = fileSize; element.removeAttribute("disabled"); } @@ -105,9 +105,9 @@ function onResponse (res) { switch (asset.name.match(REGEX_EXT).pop()) { case "xpi": downloadExtBtn.href = asset.browser_download_url; + downloadExtBtn.title = `${asset.name} (${formattedSize})`; downloadExtBtn.dataset.version = res.tag_name; downloadExtBtn.removeAttribute("disabled"); - downloadExtBtn.removeAttribute("title"); break;