User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Deprecating the spinner creator in core.js. Joomla 4 will introduce a web component for this.
So in 4.0 in each page that a spinner is needed the following steps will need to be done:
HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-core-loader.min.js', ['relative' => true, 'version' => 'auto']);
spinner = document.createElement('joomla-core-loader');
// Assuming that the spinner is full screen
document.body.appendChild(spinner);
/*
if we need to append the spinner to some other container
all we have to do is replace document.body with the element
that we want the spinner to appear
*/
spinner = document.querySelector('joomla-core-loader');
spinner.parentNode.removeChild(spinner);
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript |
Labels |
Added:
?
|
Will the old way also work in J4?
Will the old way also work in J4?
No
And I assume the new way will also not work in J3. So what does an extension dev need to do then? In PHP you can write a version compare check and then execute the relevant code depending n the major version. How do we do that on the JS side? The target is that J3 extensions will also work in J4 if they are up to date.
So what does an extension dev need to do then?
I provided the lines above the missing step, lets say if you have crap build tools and you use the same codebase for different versions is quite simple:
if (Joomla.loadingLayer && typeof Joomla.loadingLayer === 'function') {
// We are in J3 so use the old method
} else {
// We are in the future
spinner = document.createElement('joomla-core-loader');
document.body.appendChild(spinner);
}
So basically it's almost the same as the JVersion trick for the PHP part.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
Labels |
Added:
?
|
Category | JavaScript | ⇒ | JavaScript Unit Tests |
Labels |
Added:
?
?
|
Category | JavaScript Unit Tests | ⇒ | JavaScript |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-18 15:54:40 |
Closed_By | ⇒ | mbabker | |
Labels |
Removed:
?
|
I have tested this item✅ successfully on b600771
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21460.