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,9 +11,7 @@ const FocusTrap = BaseFocusTrap.extend('focustrap', {
this.autoFocus(el, binding);
}
DomHandler.setAttributes(el, {
'p-bind': this.ptm('root')
});
el.setAttribute('data-pd-focustrap', true);
this.$el = el;
},
@ -111,11 +109,11 @@ const FocusTrap = BaseFocusTrap.extend('focustrap', {
firstFocusableElement.$_pfocustrap_lasthiddenfocusableelement = lastFocusableElement;
firstFocusableElement.$_pfocustrap_focusableselector = firstFocusableSelector;
firstFocusableElement.setAttribute('data-pd-focustrap-section', 'firstfocusableelement');
firstFocusableElement.setAttribute('data-pc-section', 'firstfocusableelement');
lastFocusableElement.$_pfocustrap_firsthiddenfocusableelement = firstFocusableElement;
lastFocusableElement.$_pfocustrap_focusableselector = lastFocusableSelector;
lastFocusableElement.setAttribute('data-pd-focustrap-section', 'lastfocusableelement');
lastFocusableElement.setAttribute('data-pc-section', 'lastfocusableelement');
el.prepend(firstFocusableElement);
el.append(lastFocusableElement);