2 * @class Roo.bootstrap.form.Password
3 * @extends Roo.bootstrap.form.Input
4 * Bootstrap Password class
10 * Create a new Password
11 * @param {Object} config The config object
14 Roo.bootstrap.form.Password = function(config){
15 Roo.bootstrap.form.Password.superclass.constructor.call(this, config);
17 this.inputType = 'password';
20 Roo.extend(Roo.bootstrap.form.Password, Roo.bootstrap.form.Input, {
22 onRender : function(ct, position)
24 Roo.bootstrap.form.SecurePass.superclass.onRender.call(this, ct, position);
26 this.el.addClass('form-password');
28 this.wrap = this.inputEl().wrap({
32 this.toggle = this.wrap.createChild({
34 cls : 'password-toggle'
38 this.toggleEl().addClass('password-hidden');
40 this.toggleEl().on('click', this.onToggleClick, this);;
45 return this.el.select('button.password-toggle',true).first();
48 onToggleClick : function(e)
50 var input = this.inputEl();
51 var toggle = this.toggleEl();
53 toggle.removeClass(['password-visible', 'password-hidden']);
55 if(input.attr('type') == 'password') {
56 input.attr('type', 'text');
57 toggle.addClass('password-visible');
60 input.attr('type', 'password');
61 toggle.addClass('password-hidden');