add onblur handler to tool fields to regenerate more intuitively
This commit is contained in:
parent
5fe11ef05a
commit
c8d974718f
2 changed files with 20 additions and 3 deletions
|
|
@ -1979,8 +1979,6 @@
|
|||
}
|
||||
|
||||
SPACE.onEnterKey([
|
||||
// UI.layerSpan, function() { API.show.slices() },
|
||||
// UI.layerID, function() { API.show.layer(UI.layerID.value) },
|
||||
UI.scaleX, selectionScale,
|
||||
UI.scaleY, selectionScale,
|
||||
UI.scaleZ, selectionScale,
|
||||
|
|
@ -1999,6 +1997,16 @@
|
|||
$('rot_z'), selectionRotate
|
||||
]);
|
||||
|
||||
UC.onBlur([
|
||||
UI.toolName,
|
||||
UI.toolNum,
|
||||
UI.toolFluteDiam,
|
||||
UI.toolFluteLen,
|
||||
UI.toolShaftDiam,
|
||||
UI.toolShaftLen,
|
||||
UI.toolTaperTip,
|
||||
], updateTool);
|
||||
|
||||
UI.toolMetric.onclick = updateTool;
|
||||
UI.toolType.onchange = updateTool;
|
||||
// default show gcode pre
|
||||
|
|
|
|||
|
|
@ -73,9 +73,18 @@
|
|||
setUnits,
|
||||
confirm,
|
||||
prompt,
|
||||
alert
|
||||
alert,
|
||||
onBlur
|
||||
};
|
||||
|
||||
function onBlur(obj, fn) {
|
||||
if (Array.isArray(obj)) {
|
||||
for (let o of obj) onBlur(o, fn);
|
||||
return;
|
||||
}
|
||||
obj.addEventListener('blur', fn);
|
||||
}
|
||||
|
||||
function alert(message) {
|
||||
return confirm(message, {ok:true});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue