Skip to content

Commit ac2cb83

Browse files
committed
Fix issue with minWidth and emptyPercentage options
1 parent b302191 commit ac2cb83

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## 3.0.4dev
44

55
- Fix ruleIsMet method, include added custom validation rules.
6+
- Fix conflict between progressBarMinWidth and progressBarEmptyPercentage
7+
options.
68

79
## 3.0.3
810

src/rules.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ try {
6868
return word.length > options.common.maxChar ? 0 : score;
6969
};
7070

71-
7271
validation.wordSimilarToUsername = function (options, word, score) {
7372
var username = $(options.common.usernameField).val();
7473
if (username && word.toLowerCase().match(username.replace(/[\-\[\]\/\{\}\(\)\*\+\=\?\:\.\\\^\$\|\!\,]/g, "\\$&").toLowerCase())) {

src/ui.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ var ui = {};
170170
} else {
171171
$bar.addClass("bg-" + options.ui.colorClasses[cssClass]);
172172
}
173-
$bar.css("min-width", options.ui.progressBarMinWidth + 'px');
173+
if (percentage > 0) {
174+
$bar.css("min-width", options.ui.progressBarMinWidth + 'px');
175+
} else {
176+
$bar.css("min-width", '');
177+
}
174178
$bar.css("width", percentage + '%');
175179
};
176180

0 commit comments

Comments
 (0)