fix #7445 - password login icon
[roojs1] / roojs-bootstrap-debug.js
index 2e05d79..5ee57dc 100644 (file)
@@ -12941,6 +12941,15 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component,  {
         }
         
         this.inputEl().on('change', this.onChange, this);
+
+        if(this.hasFeedback && this.inputType != 'hidden'){
+            
+            var feedback = this.el.select('.form-control-feedback', true).first();
+
+            if(feedback) {
+                feedback.hide();
+            }
+        }
         
     },
     filterValidation : function(e){
@@ -13191,6 +13200,7 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component,  {
                 this.el.select('.form-control-feedback', true).first().removeClass(this.invalidFeedbackClass);
 
                 feedback.update('');
+                feedback.hide();
             }
             
         }
@@ -13220,6 +13230,7 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component,  {
         if(feedback){
             this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]);
             feedback.update('');
+            feedback.hide();
         }
         
         if(this.indicator){
@@ -13274,6 +13285,7 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component,  {
             this.el.select('.form-control-feedback', true).first().removeClass(
                     [this.invalidFeedbackClass, this.validFeedbackClass]);
             feedback.update('');
+            feedback.hide();
         }
 
         if(this.disabled){
@@ -13310,6 +13322,8 @@ Roo.extend(Roo.bootstrap.form.Input, Roo.bootstrap.Component,  {
                 if(!this.allowBlank && !this.getRawValue().length){
                     feedback.update(this.blankText);
                 }
+
+                feedback.show();
                 
             }
             
@@ -26020,6 +26034,57 @@ Roo.extend(Roo.bootstrap.form.SecurePass, Roo.bootstrap.form.Input, {
         return this.IsLongEnough(pwd, 6) || !this.IsLongEnough(pwd, 0);
     }
           
+});/**
+ * @class Roo.bootstrap.form.Password
+ * @extends Roo.bootstrap.form.Input
+ * Bootstrap Password class
+ * 
+ * 
+ * 
+ * 
+ * @constructor
+ * Create a new Password
+ * @param {Object} config The config object
+ */
+
+Roo.bootstrap.form.Password = function(config){
+    Roo.bootstrap.form.Password.superclass.constructor.call(this, config);
+
+    this.inputType = 'password';
+};
+
+Roo.extend(Roo.bootstrap.form.Password, Roo.bootstrap.form.Input, {
+
+    initEvents : function()
+    {   
+        Roo.bootstrap.form.Password.superclass.initEvents.call(this);
+
+        this.el.addClass('form-password');
+
+        this.inputEl().addClass('password-hidden');
+
+        this.inputEl().on('click', this.onPasswordClick, this);
+    },
+
+    onPasswordClick : function(e) 
+    {
+        var input = this.inputEl();
+
+        if(e.getPageX() < input.getX() + input.getWidth() - 30) {
+            return;
+        }
+
+        input.removeClass(['password-visible', 'password-hidden']);
+
+        if(input.attr('type') == 'password') {
+            input.attr('type', 'text');
+            input.addClass('password-visible');
+        }
+        else {
+            input.attr('type', 'password');
+            input.addClass('password-hidden');
+        }
+    }
 });Roo.rtf = {}; // namespace
 Roo.rtf.Hex = function(hex)
 {