From d8a0a70e28562bf32d997ac0e2cfc30021025ada Mon Sep 17 00:00:00 2001 From: Benard Ebinu Date: Fri, 17 Nov 2017 15:29:12 -0800 Subject: [PATCH] DIV-521: Revealing the financial support element after user presses a key instead of mouse move after feedback from designer --- edivorce/apps/core/static/js/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 64be6e11..3f955bbb 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -53,10 +53,11 @@ $(function () { $('input[type=number], input[type=radio], input[type=checkbox], input[type=text], .response-textarea, .response-dropdown').on('change', ajaxOnChange); // The designers want the dependent elements to be revealed as soon as the user completes input but before - // they click on the next button. Using the mouse move event as the trigger for checking whether or not should - // reveal dependent elements. - $('#has_children').on('mousemove', function(){ - reveal($('input[name=number_children_over_19]')); + // they click on the next button. Using the keypress event with a small timeout to mimic an on change event + // that does not require the current element to loose focus. + $('input[name=number_children_over_19]').on('keypress', function() { + var self = $(this); + setTimeout(function(){ self.trigger('change');}, 50); });