Make high contrast and draggable toolbar items mutually exclusive.
This commit is contained in:
parent
bd68d31773
commit
64d2ae84fa
|
@ -50,7 +50,7 @@ body {
|
||||||
display: block;
|
display: block;
|
||||||
top: 0;
|
top: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-align: left;
|
align-items: center;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ addEventListener("unload", e => {
|
||||||
}
|
}
|
||||||
|
|
||||||
await include("/ui/toolbar.js");
|
await include("/ui/toolbar.js");
|
||||||
|
UI.toolbarInit();
|
||||||
{
|
{
|
||||||
let handlers = {
|
let handlers = {
|
||||||
"options": e => {
|
"options": e => {
|
||||||
|
|
|
@ -18,7 +18,10 @@
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* 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 toolbar = document.getElementById("top");
|
||||||
let spacer = toolbar.querySelector(".spacer");
|
let spacer = toolbar.querySelector(".spacer");
|
||||||
let hider = toolbar.querySelector(".hider");
|
let hider = toolbar.querySelector(".hider");
|
||||||
|
|
|
@ -222,6 +222,7 @@ var UI = (() => {
|
||||||
},
|
},
|
||||||
async toggle() {
|
async toggle() {
|
||||||
let hc = "highContrast" in UI ? UI.highContrast : await this.detect();
|
let hc = "highContrast" in UI ? UI.highContrast : await this.detect();
|
||||||
|
if (UI.toolbarInit) UI.toolbarInit();
|
||||||
if (hc) {
|
if (hc) {
|
||||||
if (this.css) {
|
if (this.css) {
|
||||||
document.documentElement.appendChild(this.css);
|
document.documentElement.appendChild(this.css);
|
||||||
|
|
Loading…
Reference in New Issue