mirror of https://github.com/OCA/web.git
More robust email checkking
parent
a09f43bf34
commit
c96eb7e1d8
|
@ -27,6 +27,23 @@ openerp.web_widget_mail_send_odoo = function(instance) {
|
||||||
.text(self.get('value') || '');
|
.text(self.get('value') || '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
is_syntax_valid: function(){
|
||||||
|
var self = this;
|
||||||
|
if(!self._super())
|
||||||
|
return false;
|
||||||
|
if (!self.get("effective_readonly") && 0 < self.$("input").size() && self.$("input").val()) {
|
||||||
|
try {
|
||||||
|
var parsed_email = instance.mail.ChatterUtils.parse_email(self.$("input").val());
|
||||||
|
console.log(parsed_email)
|
||||||
|
if(!parsed_email[1])
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
} catch(e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
on_clicked: function() {
|
on_clicked: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (!self.get('value') || !self.is_syntax_valid()) {
|
if (!self.get('value') || !self.is_syntax_valid()) {
|
||||||
|
|
Loading…
Reference in New Issue