[FIX] web_editor: prevent inner snippets to toggle the grid mode
In 1, conditions have been made in order to allow/forbid each snippet to toggle the grid mode. However, a case has been forgotten: when a snippet that cannot toggle the grid mode is dropped inside a snippet that can toggle it (so it is an inner snippet). Indeed, if we drag one of the inner snippet columns, we can see that the grid mode is toggled, where it should not be the case.
This issue comes from the check looking if the grid layout option is in the right panel. Indeed, even though such a snippet does not have it, if it is dropped inside a snippet that can toggle the grid mode, then the option is well present in the right panel (= the outer snippet one).
This commit fixes this issue by improving the check: now, dragging a column can toggle the grid mode only if the container having the option is the same as the one of the column. This commit also improves the siblings removal, in order to only have the relevant dropzones, by taking this case into account.
Steps to reproduce:
- drop a Text-Image snippet
- drop a Form snippet inside one of the columns
- drag a form field => the grid mode is toggled.
opw-3100399
@qsm-odoo @rdeodoo
@qsm-odoo I made the changes :) In the end, I still had to manage the case of the inner siblings (when the outer snippet is in grid mode) so other columns cannot be dropped in them (without that, the inner dropzones were overlapping with the grid dropzone, which didn't look good and was not convenient).
@qsm-odoo I made the changes :)
@qsm-odoo I made the changes :)
