Make creator preview update after timeout, instead of each keyup

This commit is contained in:
2017-11-16 22:35:54 +01:00
parent c7e6b9b566
commit dc520ae64d
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -1,5 +1,8 @@
function submit_preview() {
document.getElementById("cardform").submit();
function submit_preview(form) { /* with timeout for ratelimiting*/
if (typeof refresh_timeout !== 'undefined') {
window.clearTimeout(refresh_timeout);
}
refresh_timeout = window.setTimeout(function(){form.submit();}, 200);
}
window.setTimeout(submit_preview, 1);
window.setTimeout(function(){document.getElementById("cardform").submit();}, 1);