widgets/SecurePass.js
[Pman.Core] / widgets / SecurePass.js
index 67fa538..bc203d5 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.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,17 @@ Ext.extend(Ext.form.SecurePass, {
 
     // private
     initEvents : function(){
-        Ext.form.SecurePass.superclass.initEvents.call(this);
-               this.el.on('keyup', this.checkStrength, this, {buffer:50});
+            if(this.inputType == 'password'){
+                this.el.on('keydown',function(event){
+                    Roo.log(event.getKey());
+                    if((event.getKey() == 8 || event.getKey() == 46) && this.getValue().length == 1){ // backspace and delete key
+                        event.preventDefault();
+                        this.setValue('');
+                    };
+                },this, {buffer:50});
+            }
+            Ext.form.SecurePass.superclass.initEvents.call(this);
+            this.el.on('keyup', this.checkStrength, this, {buffer:50});
        },
 
        // private