Fix Bug 49947
This commit is contained in:
parent
f0939c6a2b
commit
ff53ec1547
|
@ -81,12 +81,11 @@ define([
|
|||
template: _.template([
|
||||
'<div class="input-field" style="<%= style %>">',
|
||||
'<input ',
|
||||
'type="<%= type %>" ',
|
||||
'type="text" ',
|
||||
'name="<%= name %>" ',
|
||||
'spellcheck="<%= spellcheck %>" ',
|
||||
'class="form-control <%= cls %>" ',
|
||||
'placeholder="<%= placeHolder %>" ',
|
||||
'value="<%= value %>"',
|
||||
'data-hint="<%= dataHint %>"',
|
||||
'data-hint-direction="<%= dataHintDirection %>"',
|
||||
'data-hint-offset="<%= dataHintOffset %>"',
|
||||
|
@ -165,6 +164,8 @@ define([
|
|||
this._input.on('keydown', _.bind(this.onKeyDown, this));
|
||||
this._input.on('keyup', _.bind(this.onKeyUp, this));
|
||||
if (this.validateOnChange) this._input.on('input', _.bind(this.onInputChanging, this));
|
||||
if (this.type=='password') this._input.on('input', _.bind(this.checkPasswordType, this));
|
||||
|
||||
if (this.maxLength) this._input.attr('maxlength', this.maxLength);
|
||||
}
|
||||
|
||||
|
@ -183,9 +184,20 @@ define([
|
|||
|
||||
me.rendered = true;
|
||||
|
||||
if (me.value)
|
||||
me.setValue(me.value);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
checkPasswordType: function(){
|
||||
if (this._input.val() !== '') {
|
||||
(this._input.attr('type') !== 'password') && this._input.attr('type', 'password');
|
||||
} else {
|
||||
this._input.attr('type', 'text');
|
||||
}
|
||||
},
|
||||
|
||||
_doChange: function(e, extra) {
|
||||
// skip processing for internally-generated synthetic event
|
||||
// to avoid double processing
|
||||
|
@ -303,6 +315,8 @@ define([
|
|||
if (this.rendered){
|
||||
this._input.val(value);
|
||||
}
|
||||
|
||||
(this.type=='password') && this.checkPasswordType();
|
||||
},
|
||||
|
||||
getValue: function() {
|
||||
|
|
|
@ -202,20 +202,12 @@ define([
|
|||
if (this.type == Common.Utils.importTextType.DRM) {
|
||||
this.inputPwd = new Common.UI.InputField({
|
||||
el: $('#id-password-txt'),
|
||||
type: 'text',
|
||||
type: 'password',
|
||||
validateOnBlur: false,
|
||||
validation : function(value) {
|
||||
return me.txtIncorrectPwd;
|
||||
}
|
||||
});
|
||||
|
||||
this.$window.find('input').on('input', function(){
|
||||
if ($(this).val() !== '') {
|
||||
($(this).attr('type') !== 'password') && $(this).attr('type', 'password');
|
||||
} else {
|
||||
$(this).attr('type', 'text');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.initCodePages();
|
||||
if (this.preview) {
|
||||
|
|
Loading…
Reference in a new issue