[FIX] website_blog: keep consistent cover classes when changing cover image
! Note forward port: this is a partial backport, ignore when conflict For some strange reason, the cover_full class was added when the cover image was changed, without checking if the cover_narrow class was already there. The cover was then a hybrid cover_narrow cover_full. The problem was reinforced by the graphene theme which does some animation on cover_full covers.
This commit is contained in:
@@ -102,8 +102,12 @@ odoo.define('website_blog.editor', function (require) {
|
||||
editor.on('saved', self, function (event, img) {
|
||||
var url = self.$image.attr('src');
|
||||
self.$cover.css({"background-image": url ? 'url(' + url + ')' : "", 'min-height': $(window).height()-this.$cover.offset().top});
|
||||
self.$target.addClass('o_dirty cover cover_full');
|
||||
if (!self.$target.hasClass("cover")) {
|
||||
var $li = self.$el.find("[data-cover_class]").first();
|
||||
self.cover_class(type, $li.data("cover_class"), $li);
|
||||
}
|
||||
self.set_active();
|
||||
self.$target.addClass("o_dirty");
|
||||
});
|
||||
},
|
||||
cover_class : function(type, value, $li) {
|
||||
|
||||
Reference in New Issue
Block a user