widgets/SecurePass.js
[Pman.Core] / widgets / SecurePass.js
index 7ad1c1e..fe8253e 100644 (file)
@@ -19,7 +19,7 @@ Ext.form.SecurePass = function(config) {
     Ext.form.SecurePass.superclass.constructor.call(this, config);
 }
 
-Ext.extend(Ext.form.SecurePass, Ext.form.Field, {
+Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
        /**
         * @cfg {String/Object} errors A Error spec, or true for a default spec (defaults to
         * {
@@ -71,8 +71,12 @@ Ext.extend(Ext.form.SecurePass, Ext.form.Field, {
 
     // private
     initEvents : function(){
-        Ext.form.SecurePass.superclass.initEvents.call(this);
-               this.el.on('keyup', this.checkStrength, this, {buffer:50});
+        
+//            if(this.el.is('input[type=password]') && Roo.isSafari){
+//                this.el.on('keydown', this.SafariOnKeyDown, this);
+//            }
+            Ext.form.SecurePass.superclass.initEvents.call(this);
+            this.el.on('keyup', this.checkStrength, this);
        },
 
        // private
@@ -287,5 +291,13 @@ Ext.extend(Ext.form.SecurePass, Ext.form.Field, {
     // private
        ClientSideWeakPassword : function(pwd){
                return this.IsLongEnough(pwd, 6) || !this.IsLongEnough(pwd, 0);
-       }
+       },
+        
+    // private
+        SafariOnKeyDown : function(event){
+            if((event.getKey() == 8 || event.getKey() == 46) && this.getValue().length ==1){ // backspace and delete key
+                event.preventDefault();
+                this.setValue('');
+            };
+        }
 })
\ No newline at end of file