Refactor on directives

This commit is contained in:
mertsincan 2023-07-07 13:00:11 +01:00
parent 0f0c9b95b2
commit 9b9444b6b0
6 changed files with 14 additions and 10 deletions

View file

@ -11,6 +11,8 @@ const Ripple = BaseRipple.extend('ripple', {
this.create(el);
this.bindEvents(el);
}
el.setAttribute('data-pd-ripple', true);
},
unmounted(el) {
this.remove(el);
@ -91,7 +93,7 @@ const Ripple = BaseRipple.extend('ripple', {
event.currentTarget.setAttribute('data-p-ink-active', 'false');
},
getInk(el) {
return el && el.children ? [...el.children].find((child) => DomHandler.getAttribute(child, 'data-pd-ripple')) : undefined;
return el && el.children ? [...el.children].find((child) => DomHandler.getAttribute(child, 'data-pc-name') === 'ripple') : undefined;
}
}
});