File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 2.0.1dev
4+
5+ - Fix bad assignment in the plugin initialization.
6+ - Russian localization.
7+ - New option to control the events the plugin listen to.
8+
39## 2.0.0
410
511- Use six possible verdicts and six possible css classes, so they match one
Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ Let's see the options of each section.
7878 An array of strings. A list of banned words for the zxcvbn library. This
7979 option will be ignored if zxcvbn is not being used.
8080
81+ * __ events__ : ` ["keyup", "change", "paste"] ` (Array)
82+
83+ An array of strings. A list of the event names the plugin is going to listen
84+ to. Customize this option to deal with iOS 9 keyup bug.
85+
8186* __ debug__ :
8287
8388 Default: ` false ` (Boolean)
Original file line number Diff line number Diff line change @@ -91,9 +91,11 @@ var methods = {};
9191
9292 localOptions . instances = { } ;
9393 $el . data ( "pwstrength-bootstrap" , localOptions ) ;
94- $el . on ( "keyup" , onKeyUp ) ;
95- $el . on ( "change" , onKeyUp ) ;
96- $el . on ( "paste" , onPaste ) ;
94+
95+ $ . each ( localOptions . common . events , function ( idx , eventName ) {
96+ var handler = eventName === "paste" ? onPaste : onKeyUp ;
97+ $el . on ( eventName , handler ) ;
98+ } ) ;
9799
98100 ui . initUI ( localOptions , $el ) ;
99101 $el . trigger ( "keyup" ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ defaultOptions.common.zxcvbn = false;
2323defaultOptions . common . zxcvbnTerms = [
2424 // List of disrecommended words
2525] ;
26+ defaultOptions . common . events = [ "keyup" , "change" , "paste" ] ;
2627defaultOptions . common . debug = false ;
2728
2829defaultOptions . rules = { } ;
You can’t perform that action at this time.
0 commit comments