User tests: Successful: Unsuccessful:
Take loading the script for showon fields out of the foreach loop
Go to a view with showon fields, i.e. com_config.
Showon fields must work before and after the patch.
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
Labels |
Added:
?
|
Yes, but in every view is at least one.
@brianteeman Not sure if I understand right: You mean web assets are clever enough to handle multiple calls for the same asset so it is included only once, so this PR would not be necessary?
btw, "showon" already exist as an WebAsset item, you can just replace call:
HTMLHelper::_('script', 'system/showon.min.js', array('version' => 'auto', 'relative' => true));
to:
$wa->useScript('showon');
and somwhere at top of file:
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
The method $wa->useScript()
may be called 100 times, it will load the requested script only once, it does not cost performance compared to HTMLHelper::_('script')
that will search for the script file on each call.
it will work, but I would prefer to load it only when it need
I am confused about the whole showon stuff.
https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/form/renderfield.php#L26
This param "enableShowon" seems to be unknow in the system.
Category | Layout | ⇒ | Front End com_contact com_users Layout |
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-02 11:38:29 |
Closed_By | ⇒ | chmst |
Sorry, this was a mistake, can you re-open?
if you have deleted your branch then it cant be reopened
aren't you now loading it even if there are no showon fields?