[REF] website, project: fix tour dropdown-menu click
Remove jQuery usage as Bootstrap 5 don't relay on jQuery anymore, even if Bootstrap as a jQuery compatibility layer. From [1] > All the events for the dropdown are now triggered on the dropdown > toggle button and then bubbled up to the parent element. From [2] > events triggered with jQuery do not go through the native layer, so > if a handler has been bound natively, it won't be called. Note: [1] https://getbootstrap.com/docs/5.1/migration/#dropdowns [2] https://github.com/odoo/odoo/commit/a535d7c6fb5a6abe083e7d665d7243f5061a4773 Task ID: 2766483 Part-of: odoo/odoo#95450
This commit is contained in:
@@ -45,7 +45,7 @@ tour.register('personal_stage_tour', {
|
||||
content: 'Open column edit dropdown',
|
||||
trigger: '.o_kanban_header:eq(0)',
|
||||
run: function () {
|
||||
$('.o_kanban_config.dropdown .dropdown-toggle').eq(0).click();
|
||||
document.querySelector('.o_kanban_config.dropdown .dropdown-toggle').dispatchEvent(new Event('click'));
|
||||
},
|
||||
}, {
|
||||
content: "Try editing inbox",
|
||||
|
||||
@@ -81,9 +81,9 @@ tour.register('project_update_tour', {
|
||||
trigger: '.o_kanban_quick_create .o_kanban_add',
|
||||
extra_trigger: '.o_kanban_project_tasks'
|
||||
}, {
|
||||
trigger: '.o_kanban_header:eq(1)',
|
||||
trigger: '.o_kanban_group:nth-child(2) .o_kanban_header',
|
||||
run: function () {
|
||||
$('.o_kanban_config.dropdown .dropdown-toggle').eq(1).click();
|
||||
document.querySelector('.o_kanban_group:nth-child(2) .o_kanban_config.dropdown .dropdown-toggle').dispatchEvent(new Event('click'))
|
||||
}
|
||||
}, {
|
||||
trigger: ".dropdown-item.o_column_edit",
|
||||
|
||||
@@ -10,7 +10,7 @@ const toggleMegaMenu = (stepOptions) => Object.assign({}, {
|
||||
// If the mega menu is displayed inside the extra menu items, it should
|
||||
// already be displayed.
|
||||
if (!this.$anchor[0].closest('.o_extra_menu_items')) {
|
||||
this.$anchor[0].click();
|
||||
this.$anchor[0].dispatchEvent(new Event('click'))
|
||||
}
|
||||
},
|
||||
}, stepOptions);
|
||||
|
||||
Reference in New Issue
Block a user