summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js53
1 files changed, 1 insertions, 52 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 061345683b6..67e5f9b559c 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -8,7 +8,6 @@ odoo.define('web.basic_fields', function (require) {
*/
var AbstractField = require('web.AbstractField');
-var config = require('web.config');
var core = require('web.core');
var crash_manager = require('web.crash_manager');
var datepicker = require('web.datepicker');
@@ -973,72 +972,22 @@ var FieldPhone = FieldEmail.extend({
className: 'o_field_phone',
prefix: 'tel',
- /**
- * The phone widget is an extension of email, with the distinction that, in
- * some cases, we do not want to show a clickable widget in readonly.
- * In particular, we only want to make it clickable if the device can call
- * this particular number. This is controlled by the _canCall function.
- *
- * @override
- */
- init: function () {
- this._super.apply(this, arguments);
- if (this.mode === 'readonly' && !this._canCall()) {
- this.tagName = 'span';
- }
- },
- /**
- * Returns the associated link only if there is one.
- *
- * @override
- */
- getFocusableElement: function () {
- if (this.mode !== 'readonly' || this._canCall()) {
- return this._super.apply(this, arguments);
- }
- return $();
- },
-
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
- * In readonly, we only make the widget clickable if the device can call it.
- * Additionally, we obfuscate the phone number to prevent Skype from seeing it.
- *
* @override
* @private
*/
_renderReadonly: function () {
this._super();
- if (this._canCall()) {
- // Split phone number into two to prevent Skype app from finding it
- var text = this.$el.text();
- var part1 = _.escape(text.substr(0, text.length/2));
- var part2 = _.escape(text.substr(text.length/2));
- this.$el.html(part1 + "­" + part2);
- } else {
- this.$el.removeClass('o_form_uri');
- }
+
// This class should technically be there in case of a very very long
// phone number, but it breaks the o_row mechanism, which is more
// important right now.
this.$el.removeClass('o_text_overflow');
},
-
- /**
- * Phone fields are clickable in readonly on small screens ~= on phones.
- * This can be overriden by call-capable modules to display a clickable
- * link in different situations, like always regardless of screen size,
- * or only allow national calls for example.
- *
- * @override
- * @private
- */
- _canCall: function () {
- return config.device.isMobile;
- }
});
var UrlWidget = InputField.extend({