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
|
|
@ -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