[FIX]URL widget is not easily accessible
This commit is contained in:
parent
9997e55208
commit
d2a07a151d
@ -21,14 +21,14 @@ odoo.define('web.web_widget_url_check', function(require) {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var core = require('web.core');
|
var core = require('web.core');
|
||||||
var widget = require('web.form_widgets');
|
var FieldUrl = core.form_widget_registry.get('url');
|
||||||
|
|
||||||
var reUrl = /(?:https?:\/\/)?(?:[\w]+\.)([a-zA-Z\.]{2,6})([\/\w\.-]*)*\/?/;
|
var reUrl = /(?:https?:\/\/)?(?:[\w]+\.)([a-zA-Z\.]{2,6})([\/\w\.-]*)*\/?/;
|
||||||
|
|
||||||
widget.FieldUrl.include({
|
FieldUrl.include({
|
||||||
is_syntax_valid: function () {
|
is_syntax_valid: function () {
|
||||||
var val = this.$('input').val() || '';
|
var val = this.$('input').val() || '';
|
||||||
return ((val.length === 0) || reUrl.test(val));
|
return ((val.length === 0) || reUrl.test(val));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user