Improve short blackout performance when using UI blackout

master
William Toohey 9 years ago
parent 378e415f18
commit 78116da737
  1. 2
      src/css/huesUI-retro.css
  2. 2
      src/css/huesUI-weed.css
  3. 10
      src/js/HuesUI.js

@ -95,7 +95,7 @@
} }
.hues-r-container, .hues-r-controls, .hues-r-subcontrols { .hues-r-container, .hues-r-controls, .hues-r-subcontrols {
visibility: visible; visibility: inherit;
opacity: 1; opacity: 1;
transition: visibility 0.5s linear, opacity 0.5s linear; transition: visibility 0.5s linear, opacity 0.5s linear;
} }

@ -32,7 +32,7 @@
} }
.hues-w-controls, .hues-w-subcontrols, .hues-w-beatbar { .hues-w-controls, .hues-w-subcontrols, .hues-w-beatbar {
visibility: visible; visibility: inherit;
opacity: 1; opacity: 1;
transition: visibility 0.5s linear, opacity 0.5s linear; transition: visibility 0.5s linear, opacity 0.5s linear;
} }

@ -36,7 +36,7 @@ class HuesUI {
this.root = document.createElement("div"); this.root = document.createElement("div");
this.root.className = name ? name : this.constructor.name; this.root.className = name ? name : this.constructor.name;
parent.appendChild(this.root); parent.appendChild(this.root);
this.root.style.display = "none"; this.root.style.visibility = "hidden";
this.core = null; this.core = null;
@ -167,7 +167,7 @@ class HuesUI {
connectCore(core) { connectCore(core) {
this.core = core; this.core = core;
this.root.style.display = "block"; this.root.style.visibility = "visible";
if(core.resourceManager.hasUI) { if(core.resourceManager.hasUI) {
this.listContainer.appendChild(core.resourceManager.listView); this.listContainer.appendChild(core.resourceManager.listView);
} }
@ -185,7 +185,7 @@ class HuesUI {
this.core.removeEventListener(callback.name, callback.func); this.core.removeEventListener(callback.name, callback.func);
}); });
this.core = null; this.core = null;
this.root.style.display = "none"; this.root.style.visibility = "hidden";
while (this.listContainer.firstElementChild) { while (this.listContainer.firstElementChild) {
this.listContainer.removeChild(this.listContainer.firstElementChild); this.listContainer.removeChild(this.listContainer.firstElementChild);
} }
@ -197,12 +197,12 @@ class HuesUI {
// ONLY FOR CHANGING UI, NOT FOR "HIDE" FEATURE // ONLY FOR CHANGING UI, NOT FOR "HIDE" FEATURE
show() { show() {
this.root.style.display = "block"; this.root.style.visibility = "visible"
} }
// ONLY FOR CHANGING UI, NOT FOR "HIDE" FEATURE // ONLY FOR CHANGING UI, NOT FOR "HIDE" FEATURE
hide() { hide() {
this.root.style.display = "none"; this.root.style.visibility = "hidden";
} }
toggleHide() { toggleHide() {

Loading…
Cancel
Save