[MERGE] forward port branch 11.0 up to b29b545fe8

This commit is contained in:
Christophe Simonis
2018-10-16 17:53:26 +02:00
27 changed files with 329 additions and 68 deletions
@@ -948,6 +948,9 @@ var HandleWidget = AbstractField.extend({
var FieldEmail = InputField.extend({
className: 'o_field_email',
events: _.extend({}, InputField.prototype.events, {
'click': '_onClick',
}),
prefix: 'mailto',
supportedFieldTypes: ['char'],
@@ -988,7 +991,21 @@ var FieldEmail = InputField.extend({
this.$el.text(this.value)
.addClass('o_form_uri o_text_overflow')
.attr('href', this.prefix + ':' + this.value);
}
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* Prevent the URL click from opening the record (when used on a list).
*
* @private
* @param {MouseEvent} ev
*/
_onClick: function (ev) {
ev.stopPropagation();
},
});
var FieldPhone = FieldEmail.extend({
@@ -1015,6 +1032,9 @@ var FieldPhone = FieldEmail.extend({
var UrlWidget = InputField.extend({
className: 'o_field_url',
events: _.extend({}, InputField.prototype.events, {
'click': '_onClick',
}),
supportedFieldTypes: ['char'],
/**
@@ -1056,7 +1076,21 @@ var UrlWidget = InputField.extend({
.addClass('o_form_uri o_text_overflow')
.attr('target', '_blank')
.attr('href', this.value);
}
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* Prevent the URL click from opening the record (when used on a list).
*
* @private
* @param {MouseEvent} ev
*/
_onClick: function (ev) {
ev.stopPropagation();
},
});
var AbstractFieldBinary = AbstractField.extend({