Skip to content
Snippets Groups Projects
Commit 1df161db authored by qsm-odoo's avatar qsm-odoo
Browse files

[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.
parent c952e1fc
Branches
Tags
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment