From 7de6dbed4dcfba866ea9c6da1111c0258beeb647 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 13 Feb 2012 17:31:20 +0100 Subject: [PATCH] [FIX] Share wizard: unselectable url and embed code I used to like Firefox... That was before webkit. lp bug: https://launchpad.net/bugs/931364 fixed bzr revid: fme@openerp.com-20120213163120-7qt0171h81uh8bvp --- addons/web/static/src/css/base.css | 5 ++++- addons/web/static/src/js/view_form.js | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 52010906a36..cc30213a8b8 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1439,10 +1439,13 @@ label.error { .openerp .oe_forms select{ padding-top: 2px; } +.openerp .oe_forms input[readonly], +.openerp .oe_forms select[readonly], +.openerp .oe_forms textarea[readonly], .openerp .oe_forms input[disabled], .openerp .oe_forms select[disabled], .openerp .oe_forms textarea[disabled]{ - background: #E0E0E0; + background: #E0E0E0 !important; } .openerp .oe_forms textarea { resize:vertical; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c1eea014070..93acd16424f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1457,7 +1457,7 @@ openerp.web.form.FieldChar = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.find('input').prop('disabled', this.readonly); + this.$element.find('input').prop('readonly', this.readonly); }, set_value_from_ui: function() { this.value = openerp.web.parse_value(this.$element.find('input').val(), this); @@ -1480,7 +1480,7 @@ openerp.web.form.FieldChar = openerp.web.form.Field.extend({ openerp.web.form.FieldID = openerp.web.form.FieldChar.extend({ update_dom: function() { this._super.apply(this, arguments); - this.$element.find('input').prop('disabled', true); + this.$element.find('input').prop('readonly', true); } }); @@ -1588,7 +1588,7 @@ openerp.web.DateTimeWidget = openerp.web.OldWidget.extend({ }, set_readonly: function(readonly) { this.readonly = readonly; - this.$input.prop('disabled', this.readonly); + this.$input.prop('readonly', this.readonly); this.$element.find('img.oe_datepicker_trigger').toggleClass('oe_input_icon_disabled', readonly); }, is_valid: function(required) { @@ -1677,7 +1677,7 @@ openerp.web.form.FieldText = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.find('textarea').prop('disabled', this.readonly); + this.$element.find('textarea').prop('readonly', this.readonly); }, set_value_from_ui: function() { this.value = openerp.web.parse_value(this.$element.find('textarea').val(), this); @@ -2194,7 +2194,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$input.prop('disabled', this.readonly); + this.$input.prop('readonly', this.readonly); } }); @@ -3219,7 +3219,7 @@ openerp.web.form.FieldBinaryFile = openerp.web.form.FieldBinary.extend({ update_dom: function() { this._super.apply(this, arguments); this.$element.find('.oe-binary-file-set, .oe-binary-file-clear').toggle(!this.readonly); - this.$element.find('input[type=text]').prop('disabled', this.readonly); + this.$element.find('input[type=text]').prop('readonly', this.readonly); }, set_value: function(value) { this._super.apply(this, arguments);