From 824435a35f897d1cfbdb4e3e818375322e1b51f6 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Tue, 22 Jan 2019 06:30:38 +0000 Subject: [PATCH] This fixes a minor bug that occurs if there is only 1 deposit for previous year. If no min is found this makes it the same as max, only a problem for non transaction_log pages using transaction.js if there is only one deposit for the last year, not sure what will happen with 0 deposits for the last year. --- js/transaction.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/transaction.js b/js/transaction.js index 0b14aa0..4a188f8 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -404,8 +404,14 @@ $(function() { // watch that percentage doesn't acquire too many decimal points. //console.dir(range_obj); + // If no min is found this makes it the same as max + // only a problem for non transaction_log pages using transaction.js if there is only one deposit for the last year + // not sure what will happen with 0 deposits for the last year + if ( !range_obj["min"] ) { + range_obj["min"] = range_obj["max"]; + } - //initialize slider + //initialize slider if (!slider) { slider = $('#gnucash_csv_range').noUiSlider({ start: [ prev_trans, max_range ],