?
avatar angieradtke
angieradtke
22 Jul 2021

Use of custom field calendar in com_contact mailform

If the frontend template does not have class .hidden,
the calendar is always expanded.

Solution
media/system/css/fields/calendar.css

adding

.js-calendar.hidden {display:none}

avatar angieradtke angieradtke - open - 22 Jul 2021
avatar joomla-cms-bot joomla-cms-bot - change - 22 Jul 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Jul 2021
avatar brianteeman
brianteeman - comment - 22 Jul 2021

class=hidden is used in lots of places in the frontend. So the proposed solution is just a band aid for one possible issue and not a solution for the non-core template not having the required class

avatar angieradtke
angieradtke - comment - 22 Jul 2021

The calendar should be encapsulated and work everywhere.
If a template does not have the hidden class it will not work.
This is a simple fix to ensure functionality everywhere.

avatar brianteeman
brianteeman - comment - 22 Jul 2021

This is a simple fix to ensure functionality everywhere.

so submit a pull request - dont expect others to do it for you

avatar richard67
richard67 - comment - 22 Jul 2021

@angieradtke It needs to change it in the "build/media_source" here https://github.com/joomla/joomla-cms/blob/4.0-dev/build/media_source/system/css/fields/calendar.css , not in the "media" folder.

avatar angieradtke
angieradtke - comment - 22 Jul 2021

@richard67 You certainly know better than me where to change .
I'm tinkering a page here from the scratch with all possible functionalities and note possible errors.

avatar richard67
richard67 - comment - 22 Jul 2021

@richard67 You certainly know better than me where to change .

@angieradtke Well now you know it too ? Do you want to make a PR or shall someone else do it?

avatar angieradtke
angieradtke - comment - 22 Jul 2021

so submit a pull request - dont expect others to do it for you

I think I can help more by pointing out the things I find while experimenting.
@richard67
I would do it, but for you it is easy. It is not my daily buisness, so I forgot every time how it works.
For me it takes hours. Checking out the stuff to may local computer, etc...
With svn it was easy creating a patch done, but ....

avatar dgrammatiko
dgrammatiko - comment - 22 Jul 2021

The code has a class hidden because at that time IE8 and IE9 were still supported. These days an attribute hidden will do the work without any lines of CSS.

My 2c

avatar richard67
richard67 - comment - 22 Jul 2021

I'd prefer someone else than me to make a PR.

avatar angieradtke
angieradtke - comment - 22 Jul 2021

@dgrammatiko @richard67
Yes, as long as we don't have an attribute hidden and we use the class we also need appropriate CSS.

avatar dgrammatiko
dgrammatiko - comment - 22 Jul 2021

@Fedik is already patching the calendar right now for the strings, ask him to change the toggling of the class to a toggle of a hidden attribute...

Eg change

this.dropdownElement.classList.remove('hidden');

to this this.dropdownElement.removeAttribute('hidden');
and
this.dropdownElement.classList.add('hidden');
to this.dropdownElement.setAttribute('hidden', '');

2 lines of code can be done in the Github by editing the file...

avatar Fedik
Fedik - comment - 22 Jul 2021

this may be related #34791, just for reference

avatar Fedik Fedik - close - 22 Jul 2021
avatar Fedik
Fedik - comment - 22 Jul 2021

Please test #34871

avatar Fedik Fedik - change - 22 Jul 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-07-22 15:58:19
Closed_By Fedik

Add a Comment

Login with GitHub to post a comment