diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-08-18 13:10:44 +0400 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-08-18 13:10:44 +0400 |
commit | 8641e442d7eac5dc649a2e9088abea2b799a87b4 (patch) | |
tree | d4059df564d418352df6bc4727faeb61c0627ee9 | |
parent | 83df74956d74229be8cf23a30d5daf344dd57181 (diff) |
Restore old css value for wrapper and define a width of 0 for empty passwords
-rw-r--r-- | jquery.strengthify.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/jquery.strengthify.js b/jquery.strengthify.js index 9616249..41d9f6a 100644 --- a/jquery.strengthify.js +++ b/jquery.strengthify.js @@ -54,6 +54,8 @@ .append('<div class="strengthify-separator" style="left: 50%" />') .append('<div class="strengthify-separator" style="left: 75%" />') + var oldDisplayState = $('.strengthify-wrapper').css('display') + $.ajax({ cache: true, dataType: 'script', @@ -65,7 +67,7 @@ // hide strengthigy if no input is provided $('.strengthify-wrapper').css( 'display', - (password === '') ? 'none' : 'inline-block' + (password === '') ? oldDisplayState : 'inline-block' ) // calculate result @@ -102,6 +104,11 @@ options.titles[result.score] ) + // reset state for empty string password + if(password === '') { + $('.strengthify-container').css('width', 0) + } + }) }) |