Add theme_3d_systems/static/src/js/widgets/widget_system_arch.js

This commit is contained in:
Huzaifa Inam 2026-08-22 21:25:19 +00:00
parent dfaf7c577b
commit 51a092b666

View file

@ -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;