From 6676c3b18973e0dbe78f24941acf64d28c6e37d1 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Thu, 15 Mar 2018 16:20:23 +0100 Subject: [IMP] web: override size attributes in image widget Size attributes (e.g. `max-width`) are sometimes set in css (i.e. with classes, see `oe_avatar`). They must however be overriden if they are specified on the widget. Example: The `max-width: 90px` set on oe_avatar must be overriden in this case. Note that the attribute `img_width` and `img_height` have been depreciated as `width` and `height` are fulfilling the exact same purpose. --- addons/web/static/tests/fields/basic_fields_tests.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/tests/fields/basic_fields_tests.js') diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index cc041c08d7b..7a2999e18b3 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1760,7 +1760,7 @@ QUnit.module('basic_fields', { QUnit.module('FieldImage'); QUnit.test('image fields are correctly rendered', function (assert) { - assert.expect(6); + assert.expect(7); this.data.partner.records[0].__last_update = '2017-02-08 10:00:00'; this.data.partner.records[0].document = 'myimage'; @@ -1793,6 +1793,8 @@ QUnit.module('basic_fields', { "the image should have the correct class"); assert.strictEqual(form.$('div[name="document"] > img').attr('width'), "90", "the image should correctly set its attributes"); + assert.strictEqual(form.$('div[name="document"] > img').css('max-width'), "90px", + "the image should correctly set its attributes"); form.destroy(); }); -- cgit v1.2.3