fix dialog key override / restore, add named module loading

This commit is contained in:
Stewart Allen 2025-12-25 17:58:45 -05:00
commit 7290103b22
8 changed files with 37 additions and 22 deletions

View file

@ -115,7 +115,15 @@ export const api = {
clone: Object.clone,
color,
conf: settings.conf,
const: { LANG, LOCAL, SETUP, SECURE, SPACE, STACKS, ...consts },
const: {
LANG, LOCAL, SETUP, SECURE, SPACE, STACKS,
...consts,
URL: {
path: LOC.pathname,
hash: LOC.hash.substring(1),
query: LOC.search.substring(1)
}
},
/**
* Development/debug utilities
*/
@ -151,12 +159,14 @@ export const api = {
redo: noop // do.js
},
event: {
on(t,l) { return EVENT.on(t,l) },
emit(t,m,o) { return EVENT.publish(t,m,o) },
bind(t,m,o) { return EVENT.bind(t,m,o) },
alerts(clr) { alerts.update(clr) },
bind(t,m,o) { return EVENT.bind(t,m,o) },
emit(t,m,o) { return EVENT.publish(t,m,o) },
import() { api.ui.load.click() },
settings: settingsUI.trigger_event
listeners(topic) { return EVENT.targets(topic) },
on(t,l) { return EVENT.on(t,l) },
settings: settingsUI.trigger_event,
topics() { return EVENT.topics() }
},
electron: navigator.userAgent.includes('Electron'),
/**

View file

@ -208,9 +208,11 @@ function confirm(message, buttons, input, opt = {}) {
html.appendAll(opt.post);
}
dialog.innerHTML = html.join('');
dialog.onclose = () => {
feature.on_key = onkey_save;
};
function done(value) {
dialog.close();
feature.on_key = onkey_save;
if (value !== undefined) {
setTimeout(() => { resolve(value) }, 150);
}

View file

@ -253,15 +253,15 @@ class KeyboardControl {
if (handler({key:evt})) return;
}
// Handle Ctrl key combinations
// Handle widget grouping (disabled: broken, conflicts with hash settings)
if (evt.ctrlKey) {
switch (evt.key) {
case 'g': return this.#api.group.merge();
case 'u': return this.#api.group.split();
// case 'g': return this.#api.group.merge();
// case 'u': return this.#api.group.split();
}
}
switch (evt.charCode) {
switch (evt.keyCode) {
case this.#cca('`'): this.#api.show.slices(0); break;
case this.#cca('0'): {
const { max } = this.#slider.getRange();

View file

@ -62,7 +62,6 @@ class ModalControl {
// hide all modals before showing another
Object.keys(modal.#ui.modals).forEach(name => {
console.log({ name, which });
modal.#ui.modals[name].style.display = name === which ? 'flex' : '';
});