diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-05-24 13:57:47 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-05-25 17:58:54 +0200 |
| commit | 38ac59871ec529092ed4cabc58007d7ec45496ed (patch) | |
| tree | f952536cea0bd711c23a653c5516a89c9d7c8765 /addons/web_editor | |
| parent | 58e35522468d1d4c0674518f785a32be56d2c1a2 (diff) | |
[FIX] portal, web_editor: keep BS 'img-responsive' *opt-in*
Bootstrap 'img-responsive' behavior was opt-in for a reason but commit
https://github.com/odoo/odoo/commit/f79b00c3b71e02f73537cb17285a6902fc0906b5
tried to defy that anyway. This would break existing client databases
... or at least our odoo.com.
This commit adds the img-responsive class for *new* *editor* images
(still with inline-block display), preventing breaking libraries or
custom (prod) images.
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/widgets.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index b63568ff0bd..51ff585d200 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -308,7 +308,10 @@ var ImageWidget = MediaWidget.extend({ img.src += _.str.sprintf('?access_token=%s', img.access_token); } if (!self.$media.is('img')) { - self._replaceMedia($('<img/>')); + // Note: by default the images receive the bootstrap opt-in + // img-responsive class. We cannot make them all responsive + // by design because of libraries and client databases img. + self._replaceMedia($('<img/>', {class: 'img-responsive o_we_custom_image'})); } self.$media.attr('src', img.src); |
