User tests: Successful: Unsuccessful:
This PR adds events to the showing and hiding of shown elements.
So now you can trigger stuff when elements are dynamically shown or hidden, like:
document.addEventListener('showon-show', () => {
const editor = document.querySelector('.CodeMirror');
editor && editor.CodeMirror.refresh();
});
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
Labels |
Added:
?
NPM Resource Changed
|
Trigger on document was a copy/paste error. Oops. Fixed now.
Regarding the syntax of the event name, there are different syntaxes used by Joomla scripts:
messages use: joomla.alert.close
subforms use: subform-row-remove
and joomla:removed
menus use: joomla:menu-toggle
So all over the place!
Should the prefix be joomla.
or joomla:
or no prefix like in subforms?
Correct is joomla:blabla-event
https://docs.joomla.org/J4.x:ClientSideEvents
In subform is an old event, and in joomla 4 it has joomla:updated
.
Addittionaly: add bubbles: true
to CustomEvent call
Done.
One more thing, please change base branch to 4.1-dev
.
Because all new features goes there.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-11-08 21:13:39 |
Closed_By | ⇒ | regularlabs |
Please trigger this events within "changed element" instead of
document
,