From 1c3f4f0a09a99af9edb0c68d57ad987ee5cfa0e8 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 8 Dec 2014 15:34:16 -0500 Subject: [PATCH] #1395, adds setting for limiting values above/below bounds --- src/definitions/modules/progress.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/definitions/modules/progress.js b/src/definitions/modules/progress.js index 42c8c0d0f..b08326f74 100644 --- a/src/definitions/modules/progress.js +++ b/src/definitions/modules/progress.js @@ -295,6 +295,14 @@ $.fn.progress = function(parameters) { if(module.total) { module.value = Math.round( (percent / 100) * module.total); } + if(settings.limitValues) { + module.value = (module.value > 100) + ? 100 + : (module.value < 0) + ? 0 + : module.value + ; + } module.set.barWidth(percent); module.set.barLabel(); if(percent === 100) { @@ -607,6 +615,7 @@ $.fn.progress.settings = { autoSuccess : true, showActivity : true, + limitValues : true, label : 'percent', precision : 1,