From be8e49a940b6a2c8067598d5fb5aae488c89db56 Mon Sep 17 00:00:00 2001 From: Andrew Lima Date: Thu, 10 Jan 2019 16:28:58 +0200 Subject: [PATCH] Allow for higher amounts raised than goal amount . Don't break the progress bar if raised amount is higher than goal amount. --- goalProgress.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/goalProgress.js b/goalProgress.js index aae728e..126c630 100644 --- a/goalProgress.js +++ b/goalProgress.js @@ -30,6 +30,11 @@ // Calculate size of the progress bar var percentage = (currentAmountParsed / goalAmountParsed) * 100; + + // Allows for progress bar to go beyond 100% but still show correct amount raised. + if(percentage > 100) { + percentage = 100; + } var milestoneNumberClass = (percentage > defaults.milestoneNumber) ? ' ' + defaults.milestoneClass : '' @@ -58,4 +63,4 @@ }); } }); -}(window.jQuery); \ No newline at end of file +}(window.jQuery);