[FIX][MIG]Fix URL and Email widgets for v10
This commit is contained in:
parent
555fe2c375
commit
48f2f7c606
@ -27,8 +27,15 @@ odoo.define('web.web_widget_email_check', function(require) {
|
||||
|
||||
widget.FieldEmail.include({
|
||||
is_syntax_valid: function () {
|
||||
var val = this.$('input').val() || '';
|
||||
return ((val.length === 0) || reEmail.test(val));
|
||||
if (this.$input) {
|
||||
var val = this.$input.val() || '';
|
||||
return ((val.length === 0) || reEmail.test(val));
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return { FieldEmail: widget.FieldEmail };
|
||||
|
||||
});
|
||||
|
@ -27,8 +27,15 @@ odoo.define('web.web_widget_url_check', function(require) {
|
||||
|
||||
FieldUrl.include({
|
||||
is_syntax_valid: function () {
|
||||
var val = this.$('input').val() || '';
|
||||
return ((val.length === 0) || reUrl.test(val));
|
||||
if (this.$input) {
|
||||
var val = this.$input.val() || '';
|
||||
return ((val.length === 0) || reUrl.test(val));
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return { FieldUrl: FieldUrl };
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user