Skip to content

Commit

Permalink
This commit changes the code inside expenses-view.js which handles
Browse files Browse the repository at this point in the history
changes to the input values. The code was not functioning properly
when the user tabbed out of an input. This code was changed to match
the code in financial-view.js which does the same thing for the
financials section.
  • Loading branch information
mistergone committed Aug 21, 2017
1 parent f6bc34e commit 775b8bb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/disclosures/js/views/expenses-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,19 @@ var expensesView = {
* Listener function for keyup in expenses INPUT fields
*/
keyupListener: function() {
this.$reviewAndEvaluate.on( 'keyup', '[data-expenses]', function() {
this.$reviewAndEvaluate.on( 'keyup focusout', '[data-expenses]', function() {
clearTimeout( expensesView.keyupDelay );
expensesView.currentInput = $( this ).attr( 'id' );
expensesView.keyupDelay = setTimeout( function() {
if ( $( this ).is( ':focus' ) ) {
expensesView.keyupDelay = setTimeout( function() {
expensesView.inputHandler( expensesView.currentInput );
expensesView.updateView( getExpenses.values() );
}, 500 );
} else {
expensesView.inputHandler( expensesView.currentInput );
expensesView.currentInput = 'none';
expensesView.updateView( getExpenses.values() );
}, 500 );
}
} );
},

Expand Down

0 comments on commit 775b8bb

Please sign in to comment.