Add theme_3d_systems/static/src/js/widgets/widget_system_arch.js
This commit is contained in:
parent
dfaf7c577b
commit
51a092b666
1 changed files with 28 additions and 0 deletions
28
theme_3d_systems/static/src/js/widgets/widget_system_arch.js
Normal file
28
theme_3d_systems/static/src/js/widgets/widget_system_arch.js
Normal 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;
|
||||
Loading…
Reference in a new issue