[FIX] portal, web_editor: responsive images but with inline display

Commit https://github.com/odoo/odoo/commit/abde8bddf8ec45cf12aab59e95c330321158cfba
made a small change to make all images responsive when they are added
with the editor. This had however the side effect of making them go to
a new line which may not be what we want.
This commit is contained in:
qsm-odoo
2018-01-25 13:56:29 +01:00
parent 461bf2331d
commit f79b00c3b7
2 changed files with 6 additions and 2 deletions
@@ -152,6 +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);
}
// Others
::-moz-selection {
@@ -286,7 +286,7 @@ var ImageWidget = MediaWidget.extend({
var img = this.images[0];
if (!img.isDocument) {
if (!this.$media.is('img')) {
this._replaceMedia($('<img/>', {class: 'img img-responsive'}));
this._replaceMedia($('<img/>'));
}
this.$media.attr('src', img.src);
} else {
@@ -409,7 +409,7 @@ var ImageWidget = MediaWidget.extend({
var $div = $(el);
if (/gif|jpe|jpg|png/.test($div.data('mimetype'))) {
var $img = $('<img/>', {
class: 'img img-responsive',
class: 'img-responsive',
src: $div.data('url') || $div.data('src'),
});
var def = $.Deferred();