matheusgr/modeligado

Avoid update on all key down.

Closed this issue · 1 comments

You should update only if anything in the model changes.

modeligado/edit.html

Lines 55 to 70 in d2a2b21

window.onkeydown = function(e) {
if(e.which == 113) { //F2
window.convert();
return false;
}
if (!autoUpdate) {
return true;
}
if(timeout) {
clearTimeout(timeout);
timeout = null;
}
timeout = setTimeout(() => {
convert()
}, 2000)
}

Fixed on 1d9237f