diff --git a/addons/portal/static/src/less/portal.less b/addons/portal/static/src/less/portal.less
index 0e34d305fb5..9b62e37121b 100644
--- a/addons/portal/static/src/less/portal.less
+++ b/addons/portal/static/src/less/portal.less
@@ -152,9 +152,10 @@ img, .media_iframe_video, .o_image {
margin-right: @grid-gutter-width / 2;
}
}
-img {
- // Make all images responsive by default but with inline-block display
- .img-responsive(inline-block);
+img.o_we_custom_image {
+ // Images added with the editor are .img-responsive by default but should
+ // still behave like inline content.
+ display: inline-block;
}
// Others
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($('
'));
+ // 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($('
', {class: 'img-responsive o_we_custom_image'}));
}
self.$media.attr('src', img.src);