From f45bd92258df395c8f731e7115392756e36caedd Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 11 Apr 2020 20:57:46 +0800 Subject: [PATCH] theme: polish modal dialog --- theme/default/static/script.js | 2 ++ theme/default/static/style.css | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/theme/default/static/script.js b/theme/default/static/script.js index ca4f51d..d28d796 100644 --- a/theme/default/static/script.js +++ b/theme/default/static/script.js @@ -29,6 +29,8 @@ window.onload = function() { span.onclick = () => { modal.style.display = "none"; }; + modal.onclick = span.onclick; + modalImg.onclick = (ev) => ev.stopPropagation(); // Table-of-Contents generation // Don't do this on mobile; it's horrible if (window.matchMedia("(max-width: 1000px)").matches) return; diff --git a/theme/default/static/style.css b/theme/default/static/style.css index 1fefb98..7898331 100644 --- a/theme/default/static/style.css +++ b/theme/default/static/style.css @@ -418,7 +418,9 @@ h5 { top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ - overflow: auto; /* Enable scroll if needed */ + overflow: scroll; /* Enable scroll if needed */ + scrollbar-width: thin; + scrollbar-color: #888888 #00000000; background-color: rgb(0, 0, 0); /* Fallback color */ background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */ }