Make high contrast and draggable toolbar items mutually exclusive.

This commit is contained in:
hackademix 2022-02-28 15:50:56 +01:00
parent bd68d31773
commit 64d2ae84fa
4 changed files with 7 additions and 2 deletions

View File

@ -50,7 +50,7 @@ body {
display: block;
top: 0;
padding: 0;
text-align: left;
align-items: center;
line-height: 1em;
position: relative;
}

View File

@ -101,6 +101,7 @@ addEventListener("unload", e => {
}
await include("/ui/toolbar.js");
UI.toolbarInit();
{
let handlers = {
"options": e => {

View File

@ -18,7 +18,10 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
{
UI.toolbarInit = () => {
if (UI.toolbarInit.done || UI.highContrast || UI.local.highContrast)
return;
UI.toolbarInit.done = true;
let toolbar = document.getElementById("top");
let spacer = toolbar.querySelector(".spacer");
let hider = toolbar.querySelector(".hider");

View File

@ -222,6 +222,7 @@ var UI = (() => {
},
async toggle() {
let hc = "highContrast" in UI ? UI.highContrast : await this.detect();
if (UI.toolbarInit) UI.toolbarInit();
if (hc) {
if (this.css) {
document.documentElement.appendChild(this.css);