diff --git a/theme_3d_systems/static/src/js/widgets/widget_system_arch.js b/theme_3d_systems/static/src/js/widgets/widget_system_arch.js new file mode 100644 index 0000000..7702683 --- /dev/null +++ b/theme_3d_systems/static/src/js/widgets/widget_system_arch.js @@ -0,0 +1,28 @@ +/** @odoo-module **/ + +import publicWidget from '@web/legacy/js/public/public_widget'; + +publicWidget.registry.ThemeSystemArch = publicWidget.Widget.extend({ + selector: '.s_system_architecture', + + start: function () { + this._super.apply(this, arguments); + const nodes = this.el.querySelectorAll('.arch-node-card'); + + nodes.forEach((node) => { + node.addEventListener('mouseenter', () => { + const target = node.dataset.targetModule; + if (target) { + const matched = this.el.querySelectorAll(`.arch-node-card[data-target-module="${target}"]`); + matched.forEach(m => m.classList.add('node-active-highlight')); + } + }); + + node.addEventListener('mouseleave', () => { + nodes.forEach(m => m.classList.remove('node-active-highlight')); + }); + }); + }, +}); + +export default publicWidget.registry.ThemeSystemArch;