User tests: Successful: Unsuccessful:
This is a fork and continuation of @PhilETaylor , now closed, original pr
Decide for yourself which columns to display for any table. The button shows an updating count of how many columns are shown. You can NOT hide the title column or the row select checkbox as this would make the table useless.
The choice of which column to display is stored in local storage so it is persistent for you in your browser for that site.
This should be added to every table and it can also be added by extension developers to their own table by just adding one line to the existing web assets.
// add the script
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns');
For the purposes of this pr it has only been applies to com_content articles and com_content featured articles
As there is new js you will need to run npm ci
The code from @PhilETaylor for local storage is not working 100% and I have no idea why. Its as if its being applied to a row instead of a column. See video below. ALL HELP on this part greatly appreciated. The js is almost meaningless to me so I can't fix it myself.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content Language & Strings JavaScript Repository NPM Change |
Labels |
Added:
Language Change
NPM Resource Changed
?
|
Category | Administration com_content Language & Strings JavaScript Repository NPM Change | ⇒ | Administration com_content Language & Strings Repository NPM Change JavaScript Libraries |
Cannot say from code review, need to debug.
Probably something wrong with some querySelector or some index.
Will try to check later.
The answer that the js is a horror, I have made PR with updates.
The answer that the js is a horror
I have never pretended to be a professional JavaScript developer, and @dgrammatiko provided some of the code for me and I butchered it further.
I do not blame anyone, I just state the reason ;)
As a side note - Joomla is meant to be a content manager, but not up to 50% of the pixels on the screen, are nothing to do with the content of the page... we need to address this eventually... and depending on the screen, up to 3-4inches from the top of the page, the content now starts, this PR pushes the content even further down... this is why this toggle needs to come AFTER the content.
@PhilETaylor can you please remove that gif as the flashing is triggering
@Fedik Thanks very much - now I just need to update it with the code to preserve the title column.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-01-06 20:15:11 |
Closed_By | ⇒ | brianteeman |
Closing here - will submit as a new pr shortly
@Fedik any ideas on the js bug?