support adding modal dialogs in modules. add bambu printer manager dialog

This commit is contained in:
Stewart Allen 2025-01-26 22:46:44 -05:00
commit eb3bb95f4d
4 changed files with 83 additions and 23 deletions

View file

@ -881,17 +881,19 @@ gapp.register("kiri.init", (root, exports) => {
modal: $('modal'),
modalBox: $('modal-box'),
help: $('mod-help'),
setup: $('mod-setup'),
prefs: $('mod-prefs'),
files: $('mod-files'),
saves: $('mod-saves'),
tools: $('mod-tools'),
xany: $('mod-x-any'),
xsla: $('mod-x-sla'),
xlaser: $('mod-x-laser'),
local: $('mod-local'),
any: $('mod-any'),
modals: {
help: $('mod-help'),
setup: $('mod-setup'),
prefs: $('mod-prefs'),
files: $('mod-files'),
saves: $('mod-saves'),
tools: $('mod-tools'),
xany: $('mod-x-any'),
xsla: $('mod-x-sla'),
xlaser: $('mod-x-laser'),
local: $('mod-local'),
any: $('mod-any'),
},
catalogBody: $('catalogBody'),
catalogList: $('catalogList'),

View file

@ -641,8 +641,9 @@ gapp.register("kiri.main", (root, exports) => {
visible = modalShowing(),
info = { pct: 0 };
["help","setup","tools","prefs","saves","files","xany","xlaser","xsla","local","any"].forEach(name => {
UI[name].style.display = name === which ? 'flex' : '';
// hide all modals befroe showing another
Object.keys(UI.modals).forEach(name => {
UI.modals[name].style.display = name === which ? 'flex' : '';
});
function ondone() {