adding delay after user input to prevent jank as chart refreshes

master
Jollus88 4 years ago committed by Mike Bryant
parent dd91bf1ea4
commit dd63511130

@ -52,6 +52,15 @@ i18next
}); });
// init set content // init set content
$(document).ready(initialize); $(document).ready(initialize);
$(document).on('input', updateContent);
let delayTimer;
$(document).on('input', function() {
// adding short delay after input to help mitigate potential lag after keystrokes
clearTimeout(delayTimer);
delayTimer = setTimeout(function() {
updateContent();
}, 1000);
});
$('input[type = radio]').on('change', updateContent); $('input[type = radio]').on('change', updateContent);
}); });

Loading…
Cancel
Save