[FIX] website: permit to save when two TOC are on the same page
Since [this commit], when dropping several "table of content" blocks on the same page, it was impossible to save. This commit solves this problem. Steps to reproduce the resolved bug: - In edit mode, drop two TOC blocks - Click on Save => the UI is blocked [this commit]: https://github.com/odoo/odoo/commit/06b03ba5ef8375b1236f6ecb52ac468124e910ba Related to opw-3047375 Related to opw-3035502 task-2948895 X-original-commit: a6de596017cdbd0da10b4050da132d46dc82a491 Part-of: odoo/odoo#107732
This commit is contained in:
@@ -25,7 +25,10 @@ const TableOfContent = publicWidget.Widget.extend({
|
||||
if (indexCallback >= 0) {
|
||||
extraMenuUpdateCallbacks.splice(indexCallback, 1);
|
||||
}
|
||||
this._scrollingElement.scrollspy('dispose');
|
||||
const scrollSpyInstance = ScrollSpy.getInstance(this._scrollingElement);
|
||||
if (scrollSpyInstance) {
|
||||
scrollSpyInstance.dispose();
|
||||
}
|
||||
this.$el.css('top', '');
|
||||
this.$el.find('.s_table_of_content_navbar').css('top', '');
|
||||
this._super(...arguments);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import wTourUtils from 'website.tour_utils';
|
||||
|
||||
wTourUtils.registerWebsitePreviewTour('snippet_table_of_content', {
|
||||
test: true,
|
||||
url: '/',
|
||||
edition: true,
|
||||
}, [
|
||||
wTourUtils.dragNDrop({id: 's_table_of_content', name: 'Table of Content'}),
|
||||
wTourUtils.dragNDrop({id: 's_table_of_content', name: 'Table of Content'}),
|
||||
// To make sure that the public widgets of the two previous ones started.
|
||||
wTourUtils.dragNDrop({id: 's_banner', name: 'Banner'}),
|
||||
...wTourUtils.clickOnSave(),
|
||||
]);
|
||||
@@ -49,3 +49,6 @@ class TestSnippets(HttpCase):
|
||||
|
||||
def test_07_image_gallery(self):
|
||||
self.start_tour(self.env['website'].get_client_action_url('/'), 'snippet_image_gallery', login='admin')
|
||||
|
||||
def test_08_table_of_content(self):
|
||||
self.start_tour(self.env['website'].get_client_action_url('/'), 'snippet_table_of_content', login='admin')
|
||||
|
||||
Reference in New Issue
Block a user