[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user