From 3c53386e0873a34a612e09df89823fde716f2679 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sun, 18 Feb 2018 11:33:23 -0800 Subject: [PATCH] Debounce works --- static/js/cowyo.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/cowyo.js b/static/js/cowyo.js index f58a122..9d90886 100644 --- a/static/js/cowyo.js +++ b/static/js/cowyo.js @@ -27,6 +27,7 @@ $(window).load(function() { // This will apply the debounce effect on the keyup event // And it only fires 500ms or half a second after the user stopped typing var prevText = $('#userInput').val(); + console.log("debounce: " + window.cowyo.debounceMS) $('#userInput').on('keyup', debounce(function() { if (prevText == $('#userInput').val()) { return // no changes @@ -39,7 +40,7 @@ $(window).load(function() { $('#saveEditButton').removeClass() $('#saveEditButton').text("Saving") upload(); - }, window.debounceMS)); + }, window.cowyo.debounceMS)); var latestUpload = null, needAnother = false; function upload() {