diff --git a/src/kiri/app/platform.js b/src/kiri/app/platform.js
index 2ef9ee30..1860a932 100644
--- a/src/kiri/app/platform.js
+++ b/src/kiri/app/platform.js
@@ -1146,28 +1146,52 @@ function loadSVGDialog(doit) {
* @private
*/
function loadDXFDialog(doit) {
- const opt = {pre: [
- "
",
- "
Import DXF
",
- "
",
- " Extrude a 3D model from a 2D DXF.",
- " Supports POLYLINE, LWPOLYLINE, LINE, CIRCLE, ARC, and SPLINE entities.",
- "
",
- "
",
- "
"
- ]};
- api.uc.confirm(undefined, {convert:true, cancel:false}, undefined, opt).then((ok) => {
- let depth = Math.max(0.1, parseFloat($('dxf-depth').value));
- let segmentSize = Math.max(0.01, parseFloat($('dxf-seg').value));
- let minSegments = Math.max(3, parseInt($('dxf-min').value));
- let soup = $('dxf-nest').checked;
- ok && doit({ soup, depth, segmentSize, minSegments });
- });
+ const rnd = Date.now().toString(36);
+ const host = $('mod-any');
+ host.innerHTML = [
+ ``,
+ `
Import DXF
`,
+ `
`,
+ ` Extrude a 3D model from a 2D DXF.`,
+ ` Supports POLYLINE, LWPOLYLINE, LINE, CIRCLE, ARC, and SPLINE entities.`,
+ `
`,
+ `
`,
+ `
`,
+ ` `,
+ ` `,
+ `
`,
+ `
`
+ ].join('');
+
+ const depth = $(`dxf-depth-${rnd}`);
+ const segmentSize = $(`dxf-seg-${rnd}`);
+ const minSegments = $(`dxf-min-${rnd}`);
+ const nest = $(`dxf-nest-${rnd}`);
+ const okBtn = $(`dxf-convert-ok-${rnd}`);
+ const cancelBtn = $(`dxf-convert-cancel-${rnd}`);
+
+ okBtn.onclick = () => {
+ api.modal.hide();
+ setTimeout(() => {
+ doit({
+ soup: nest.checked,
+ depth: Math.max(0.1, parseFloat(depth.value)),
+ segmentSize: Math.max(0.01, parseFloat(segmentSize.value)),
+ minSegments: Math.max(3, parseInt(minSegments.value))
+ });
+ }, 50);
+ };
+ cancelBtn.onclick = () => api.modal.hide();
+ depth.onkeypress = (ev) => {
+ if (ev.key === 'Enter' || ev.charCode === 13) okBtn.click();
+ };
+ api.modal.show('any');
+ setTimeout(() => depth.focus(), 0);
}
/**