NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
4 Aug 2019

Redo of #22491

Summary of Changes

  • Drops the code from the core.js for the spinner (already deprecated in j3) and introduces a web component
  • Patched the category edit layout to work with the new element
  • Patched the installation to work with the new element
  • Patched the com_associations to work with the new element

Testing Instructions

Install Joomla, spinner is ok
Make sure that you have custom fields assigned to one category. Edit an article and change its cat to the one that custom fields are attached. spinner is ok
Try a multilingual and check if the spinner works ok

Expected result

Actual result

Aug-04-2019 13-39-30

Documentation Changes Required

In 4.0 in each page that a spinner is needed the following steps will need to be done:

  • Include the web component
HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-core-loader.min.js', ['relative' => true, 'version' => 'auto']);
  • To show the spinner all we need to do is create an element:
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
*/
  • To remove the spinner all we need to do is destroy the element:
spinner = document.querySelector('joomla-core-loader');

spinner.parentNode.removeChild(spinner);

if you want to use the same codebase for different versions (j3 and j4) here is a quick code:

if (Joomla.loadingLayer && typeof Joomla.loadingLayer === 'function') {
 // We are in J3 so use the old method
 Joomla.loadingLayer('show');
} else {
 // We are in the future
spinner = document.createElement('joomla-core-loader');
document.body.appendChild(spinner);
}

@wilsonge

3f7fdf9 4 Aug 2019 avatar dgrammatiko init
e256a48 4 Aug 2019 avatar dgrammatiko init
536d397 4 Aug 2019 avatar dgrammatiko init
avatar dgrammatiko dgrammatiko - open - 4 Aug 2019
avatar dgrammatiko dgrammatiko - change - 4 Aug 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Aug 2019
Category Administration com_associations com_categories JavaScript Repository NPM Change Installation
avatar dgrammatiko dgrammatiko - change - 4 Aug 2019
Labels Added: NPM Resource Changed ?
avatar wilsonge
wilsonge - comment - 10 Aug 2019

This looks ok. I'm just going to hold on merging this until the new template is in

avatar wilsonge wilsonge - change - 29 Aug 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-08-29 19:41:10
Closed_By wilsonge
avatar wilsonge wilsonge - close - 29 Aug 2019
avatar wilsonge wilsonge - merge - 29 Aug 2019
avatar wilsonge
wilsonge - comment - 29 Aug 2019

Thanks!

avatar dgrammatiko
dgrammatiko - comment - 29 Aug 2019

Thanks

avatar Quy
Quy - comment - 19 Sep 2019

On Windows 10, the logo does not spin during installation in Firefox and Chrome. Can you check? Thanks.

avatar C-Lodder
C-Lodder - comment - 19 Sep 2019

@Quy does this work for you? https://codepen.io/charlie-lodder/pen/rNBQBev

Only difference is that it doesn't use Shadow DOM, which shouldn't really make a difference

avatar Quy
Quy - comment - 19 Sep 2019

It does not. I assume it will automatically spin upon loading the page.

avatar Quy
Quy - comment - 19 Sep 2019

The solution is here, but it would be nice to fix it without having to enable Show Animations.

Add a Comment

Login with GitHub to post a comment