widgets/SecurePass.js
[Pman.Core] / widgets / SecurePass.js
index 6d91c8e..f98c0ea 100644 (file)
@@ -71,8 +71,17 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
 
     // private
     initEvents : function(){
-        Ext.form.SecurePass.superclass.initEvents.call(this);
-               this.el.on('keyup', this.checkStrength, this, {buffer:50});
+            Roo.log(this);
+            if(this.inputType == 'password'){
+                this.el.on('keydown',function(event){
+                    if((event.getKey() == 8 || event.getKey() == 46) && this.getValue().length ==1){ // backspace and delete key
+                        event.preventDefault();
+                        this.setValue('');
+                    };
+                },this);
+            }
+            Ext.form.SecurePass.superclass.initEvents.call(this);
+            this.el.on('keyup', this.checkStrength, this, {buffer:50});
        },
 
        // private
@@ -131,8 +140,6 @@ Ext.extend(Ext.form.SecurePass, Ext.form.TextField, {
        // private
        checkStrength : function(){
                var pwd = this.el.getValue();
-                Roo.log('run');
-                Roo.log(this._lastPwd);
                if (pwd == this._lastPwd) {
                        return;
                }