mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 10:59:28 +08:00
InputField: hide errors on input
This commit is contained in:
@ -73,7 +73,8 @@ define([
|
||||
validateOnChange: false,
|
||||
validateOnBlur: true,
|
||||
disabled: false,
|
||||
editable: true
|
||||
editable: true,
|
||||
hideErrorOnInput: false
|
||||
},
|
||||
|
||||
template: _.template([
|
||||
@ -114,6 +115,7 @@ define([
|
||||
this.validateOnChange = me.options.validateOnChange;
|
||||
this.validateOnBlur = me.options.validateOnBlur;
|
||||
this.maxLength = me.options.maxLength;
|
||||
this.hideErrorOnInput = me.options.hideErrorOnInput;
|
||||
|
||||
me.rendered = me.options.rendered || false;
|
||||
|
||||
@ -361,7 +363,12 @@ define([
|
||||
if (modalParents.length > 0) {
|
||||
errorBadge.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10);
|
||||
}
|
||||
|
||||
if (me.hideErrorOnInput) {
|
||||
var onInputChanging = function() {
|
||||
me.showError();
|
||||
};
|
||||
me._input.one('input', onInputChanging);
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
} else {
|
||||
@ -391,6 +398,12 @@ define([
|
||||
if (modalParents.length > 0) {
|
||||
errorBadge.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10);
|
||||
}
|
||||
if (me.hideErrorOnInput) {
|
||||
var onInputChanging = function() {
|
||||
me.showError();
|
||||
};
|
||||
me._input.one('input', onInputChanging);
|
||||
}
|
||||
} else {
|
||||
me.cmpEl.removeClass('error');
|
||||
me.cmpEl.removeClass('warning');
|
||||
|
||||
@ -88,6 +88,7 @@ define([], function () { 'use strict';
|
||||
el: $('#id-dlg-title'),
|
||||
allowBlank: false,
|
||||
validateOnBlur: false,
|
||||
hideErrorOnInput: true,
|
||||
validation: function(value) {
|
||||
return value.length === 0 ? this.txtPropertyTitleBlankError : true;
|
||||
}
|
||||
@ -124,6 +125,7 @@ define([], function () { 'use strict';
|
||||
el: $('#id-dlg-value-input'),
|
||||
style: 'width: 100%;',
|
||||
validateOnBlur: false,
|
||||
hideErrorOnInput: true,
|
||||
validation: function(value) {
|
||||
if (value.length === 0) {
|
||||
return this.txtPropertyValueBlankError;
|
||||
@ -168,6 +170,7 @@ define([], function () { 'use strict';
|
||||
blankError : this.txtPropertyValueBlankError,
|
||||
validateOnBlur: false,
|
||||
value : '',
|
||||
hideErrorOnInput: true,
|
||||
dataHint : '1',
|
||||
dataHintDirection: 'left',
|
||||
dataHintOffset: 'small'
|
||||
|
||||
Reference in New Issue
Block a user