Skip to content

Commit 2a81ac3

Browse files
committed
Add new ui.progressBarMinWidth option
1 parent e846a82 commit 2a81ac3

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- Add Arabic localization.
66
- Add Norwegian localization.
7+
- Add new option ui.progressBarMinWidth to control the minimum width of the
8+
progress bar.
79

810
## 3.0.2
911

OPTIONS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ Let's see the options of each section.
258258
Minimum percentage filled in the progress bar that depicts the strength of
259259
the password. An empty password will show the progress bar filled this much.
260260

261+
* __progressBarMinWidth__:
262+
263+
Default: `1` (Integer)
264+
265+
Minimum width in pixels filled in the progress bar that depicts the
266+
strength of the password. A terrible but not empty password will show the
267+
progress bar filled this many pixels. Makes use of the `min-width` CSS
268+
property.
269+
261270
* __progressBarMinPercentage__:
262271

263272
Default: `1` (Integer)

src/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ defaultOptions.ui.colorClasses = [
184184
];
185185
defaultOptions.ui.showProgressBar = true;
186186
defaultOptions.ui.progressBarEmptyPercentage = 1;
187+
defaultOptions.ui.progressBarMinWidth = 1;
187188
defaultOptions.ui.progressBarMinPercentage = 1;
188189
defaultOptions.ui.progressExtraCssClasses = '';
189190
defaultOptions.ui.progressBarExtraCssClasses = '';

src/ui.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ var ui = {};
170170
} else {
171171
$bar.addClass("bg-" + options.ui.colorClasses[cssClass]);
172172
}
173+
$bar.css("min-width", options.ui.progressBarMinWidth + 'px');
173174
$bar.css("width", percentage + '%');
174175
};
175176

0 commit comments

Comments
 (0)