properly handle expanding preview in developer mode

This commit is contained in:
Stewart Allen 2025-12-25 22:16:13 -05:00
commit 1f663f3cc9
4 changed files with 22 additions and 4 deletions

View file

@ -328,7 +328,8 @@ function exportGCodeDialog(gcode, sections, info, names) {
api.modal.show('xany');
let set = api.conf.get();
let fdm = MODE === MODES.FDM;
let octo = set.controller.exportOcto && MODE !== MODES.CAM;
let cam = MODE === MODES.CAM;
let octo = set.controller.exportOcto && !cam;
let preview = set.controller.exportPreview;
$('code-preview-head').style.display = preview ? '' : 'none';
$('code-preview').style.display = preview ? '' : 'none';
@ -337,8 +338,8 @@ function exportGCodeDialog(gcode, sections, info, names) {
$('print-filename').value = filename;
$('print-filesize').value = util.comma(info.bytes);
$('print-length').value = Math.round(info.distance);
if (set.controller.devel) {
$('code-preview-textarea').style.height = "30em";
if ((fdm || cam) && preview && set.controller.devel) {
document.body.classList.add('devel');
}
calcTime();
if (fdm) {

View file

@ -60,6 +60,9 @@ class ModalControl {
visible = modal.visible(),
info = { pct: 0 };
// if the dialog needs it, it will re-add it
document.body.classList.remove('devel');
// hide all modals before showing another
Object.keys(modal.#ui.modals).forEach(name => {
modal.#ui.modals[name].style.display = name === which ? 'flex' : '';