From 4ce8ae8bb16e19e7ee237bdccd9a367e790d9d93 Mon Sep 17 00:00:00 2001 From: "Sideways S." Date: Thu, 5 Dec 2024 13:16:39 -0600 Subject: [PATCH] couple of app fixes --- apps/color/index.css | 3 ++- apps/load.js | 17 +++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/color/index.css b/apps/color/index.css index 22cdda3..806b237 100644 --- a/apps/color/index.css +++ b/apps/color/index.css @@ -222,6 +222,7 @@ state-btn:active { align-self:stretch; border-radius:2px; } -color-picker::part(details) { +color-picker::part(details), +color-picker::part(color-space) { display: none; } \ No newline at end of file diff --git a/apps/load.js b/apps/load.js index 3f688fb..eb9c2b7 100644 --- a/apps/load.js +++ b/apps/load.js @@ -17,7 +17,7 @@ import {MILLI, COUNT, ONE, INPUT, SELECT, BUTTON, DIV, LABEL, dlg, elms, g, import(_load.js): load, getEasies, initEasies, updateAll, easeFinally, resizeWindow */ -let awaitNamed, awaitUpdate, ns, ns_named; +let ns, ns_named; const RESIZE = "resize"; const awaitFonts = [ // start loading fonts asap @@ -90,8 +90,6 @@ function loadCommon() { is = ns.load(byTag, hasVisited), // the rest of the async processes: msg = "Error fetching common.json: presets & tooltips are unavailable"; - awaitNamed = Ez.promise(); // these two resolve in loadJSON() - awaitUpdate = Ez.promise(); fetch("../common.json") .then (rsp => loadJSON(rsp, is, dir, ns, name, hasVisited, byTag, msg)) .catch(err => errorAlert(err, msg)); @@ -104,6 +102,7 @@ function loadCommon() { function loadJSON(response, is, dir, ns, name, hasVisited, byTag, msg) { if (response.ok) response.json().then(json => { + const awaitNamed = Ez.promise(); g.presets = json.presets; // must precede loadNamed() loadNamed(is.multi, dir, ns) .then(namespace => { @@ -125,20 +124,18 @@ function loadJSON(response, is, dir, ns, name, hasVisited, byTag, msg) { } } const awaitCustom = - byTag.slice (-4) // the page's custom elements + byTag.slice (-4) // the page's custom elements, by tag .filter(v => v.length) .map (v => customElements.whenDefined(v[0].localName)); if (is.promise) awaitCustom.push(is.promise); - if (is.easings) { // byTag is missing clones - const nums = [...document.getElementsByTagName("input-num")]; + if (is.easings) // byTag is missing clones awaitCustom.push( - ...nums.map(num => BaseElement.promises.get(num)) + ...Array.from(document.getElementsByTagName("input-num")) + .map (inp => BaseElement.promises.get(inp)) ); - } - Promise.all([document.fonts.ready, awaitNamed, ...awaitCustom]) - .then (() => loadFinally(is, name, hasVisited, id)) + .then (() => loadFinally(is, name, hasVisited, id)) .catch(errorAlert); }).catch(errorAlert);