Browse Source

Fixes bug with normalize value returning 100 when total is > 100

pull/3792/head
Jack Lukic 9 years ago
parent
commit
af06c7a930
2 changed files with 9 additions and 6 deletions
  1. 2
      RELEASE-NOTES.md
  2. 13
      src/definitions/modules/progress.js

2
RELEASE-NOTES.md

@ -59,6 +59,8 @@
-**Table** - More granular variables for controlling style on first column in a `definition table`
**Docs**
- **Progress** - Added new examples to progress
- **Progress** - Added all available behaviors with progress
- **Form** - Added example of using custom rules with form
- **Build Tools** - Added explanation of using SUI with CI, and auto-install in "recipes" section.
- **Build Tools** - Added explanation of how to build RTL in "recipes" section

13
src/definitions/modules/progress.js

@ -148,7 +148,6 @@ $.fn.progress = function(parameters) {
if( module.has.total() ) {
startValue = module.get.value();
incrementValue = incrementValue || 1;
newValue = startValue + incrementValue;
}
else {
@ -221,9 +220,11 @@ $.fn.progress = function(parameters) {
module.debug('Value cannot decrement below 0');
return 0;
}
if(module.has.total() && value > module.total) {
module.debug('Value cannot increment above total', module.total);
return module.total;
if(module.has.total()) {
if(value > module.total) {
module.debug('Value cannot increment above total', module.total);
return module.total;
}
}
else if(value > 100 ) {
module.debug('Value cannot increment above 100 percent');
@ -291,7 +292,7 @@ $.fn.progress = function(parameters) {
return module.percent || 0;
},
value: function() {
return module.value || 0;
return module.nextValue || module.value || 0;
},
total: function() {
return module.total || false;
@ -309,7 +310,7 @@ $.fn.progress = function(parameters) {
is: {
complete: function() {
module.is.success() || module.is.warning() || module.is.error();
return module.is.success() || module.is.warning() || module.is.error();
},
success: function() {
return $module.hasClass(className.success);

Loading…
Cancel
Save