Commit 96de079d authored by sajolida's avatar sajolida
Browse files

Move display logic from CSS to JS

parent fe492319
......@@ -21,8 +21,13 @@ document.addEventListener("DOMContentLoaded", function() {
else if (event.data.action === "progress") {
showVerificationProgress(event.data.percentage);
}
else if (event.data.action === "extension-installed" && document.documentElement.dataset.extension === "up-to-date") {
showVerifyDownload();
else if (event.data.action === "extension-installed") {
if (document.documentElement.dataset.extension === "up-to-date") {
showVerifyDownload();
}
else if (document.documentElement.dataset.extension === "outdated") {
showUpdateExtension();
}
}
}
......@@ -173,6 +178,12 @@ document.addEventListener("DOMContentLoaded", function() {
toggleContinueLink("direct", "skip-verification-direct");
}
function showUpdateExtension() {
hide(document.getElementById("verification"));
hide(document.getElementById("install-extension"));
show(document.getElementById("update-extension"));
}
function showVerifyDownload() {
hide(document.getElementById("install-extension"));
hide(document.getElementById("update-extension"));
......
......@@ -31,18 +31,6 @@
opacity: 0.3;
}
/* Display logic in case the extension is installed or outdated */
html[data-extension="up-to-date"] #install-extension,
html[data-extension="outdated"] #install-extension {
display: none;
}
html[data-extension="outdated"] #update-extension,
html[data-extension="up-to-date"] #verification {
display: block;
}
/* Layout */
#content {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment