hide palette editor when source selection changes

This commit is contained in:
Stewart Allen 2021-11-15 14:21:59 -05:00
commit 2668d7c06e

View file

@ -111,6 +111,7 @@
function filamentSourceEditUpdate() { function filamentSourceEditUpdate() {
if (UI.filamentSource && UI.filamentSourceEdit) { if (UI.filamentSource && UI.filamentSourceEdit) {
API.event.emit("filament.source");
const sel = UI.filamentSource.options[UI.filamentSource.selectedIndex]; const sel = UI.filamentSource.options[UI.filamentSource.selectedIndex];
if (sel) { if (sel) {
UI.filamentSourceEdit.style.display = sel.value === 'palette3' ? '' : 'none'; UI.filamentSourceEdit.style.display = sel.value === 'palette3' ? '' : 'none';
@ -2836,16 +2837,13 @@
}; };
}; };
}; };
API.event.on("device.select", () => { API.event.on(["device.select", "filament.source"], () => {
UI.extruder.parentNode.style.display = 'flex'; UI.extruder.parentNode.style.display = 'flex';
UI.palette.parentNode.style.display = 'none'; UI.palette.parentNode.style.display = 'none';
btn.innerText = 'edit'; btn.innerText = 'edit';
btn.onclick = edit; btn.onclick = edit;
}); });
API.event.on("device.save", () => { API.event.on("device.save", editDone);
console.log('before device save');
editDone();
});
} }
} }