Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Usability: Component and Item radio group options styling is not working properly #18917

Closed
wants to merge 6 commits into from

Conversation

machadoug
Copy link

@machadoug machadoug commented Nov 29, 2017

I'm testing my extensions with Joomla 4.0 and I noticed a couple of styling issues with the options from the XML files.

The Lists requires two clicks in order to select an option, therefore when we have up to 4 options we always use radio buttons in order to improve usability. However the class="btn-group" is not working properly.

Example XML Code

<field name="gmaps_linkToGoogleEarth" type="radio" default=""
		class="btn-group" useglobal="true"
		description="CE_GMAPS_LINK_OUTPUT_DESC">
	<option value="gmaps">CE_GMAPS_LINK_OUTPUT_OPT_GOOGLE_MAPS</option>
	<option value="gearth">CE_GMAPS_LINK_OUTPUT_OPT_GOOGLE_EARTH</option>
</field>

Expected result

XML options using useglobal=true in Joomla 3.8
Image of XML options using useglobal=true in Joomla 3.8

Actual result

XML options using useglobal=true in Joomla 4.0 Alpha2
Image of XML options using useglobal=true in Joomla 4.0 Alpha2

Result after proposed changes

Image of XML options using useglobal=true in Joomla 4.0 Alpha2 after proposed changes

Solution

Add the CSS code .btn-group.radio{display:inline-block} to
joomla-cms/templates/cassiopeia/css/template.min.css

Also, the Use global should be blue (Bootstrap primary class), therefore we need to remove the btn-outline-primary class from the label.

@@ -1,3 +1,6 @@
// Radio button group
.btn-group.radio{display:inline-block}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening curly brace in a single line rule set { should be preceded by at least one space
Declaration should be terminated by a semicolon
Colon after property should be followed by at least one space

@brianteeman
Copy link
Contributor

Obviously the switcher doesnt support more than two options or it wouldnt be a switch

@C-Lodder
Copy link
Member

Grouped buttons will derive from custom elements, so probably not muh point in trying to fix this here

@Bakual
Copy link
Contributor

Bakual commented Nov 29, 2017

@brianteeman This is not about the switcher. It's about radio buttons (button groups). The switcher uses the class "switcher".

@machadoug
Copy link
Author

@Bakual , I wrongly mentioned the switcher, therefore I removed my comments about it in order to avoid any confusion.

@C-Lodder, the template Javascript file /administrator/templates/atum/js/template.js implements grouped buttons, therefore IMHO it should be fixed here.

This fixes each option colors:
Use Global = Primary (blue)
0 or false = danger (red)
anything else = success (green)
@dgrammatiko
Copy link
Contributor

therefore IMHO it should be fixed here.

Nope! That code was wrongly put there it belongs to the field that actually renders those inputs. We'll fix this when we'll move the code to the custom elements. On our todo list

@machadoug
Copy link
Author

@dgt41 great to know. Thanks.
Anyway the Javascript code needs updating in order to display correctly the colors. In my last change to administrator/templates/atum/js/template.js I've fixed the colors based on the value.

@ghost
Copy link

ghost commented Dec 9, 2017

We'll fix this when we'll move the code to the custom elements.

@dgt41 Can this Pull Request be closed?

@dgrammatiko
Copy link
Contributor

@franz-wohlkoenig nope, let's get some tests and merge this. Later on we'll move the code where it rightfully belongs

@brianteeman
Copy link
Contributor

@dgrammatiko what is the status here?

@C-Lodder
Copy link
Member

C-Lodder commented Aug 9, 2018

I believe this will throw the error:

Undefined variable 'j'

Seeing as the addition for loop was removed where this variable was declared

@ghost ghost added the J4 Issue label Apr 5, 2019
@ghost ghost removed the J4 Issue label Apr 13, 2019
@sanderpotjer
Copy link
Member

@wilsonge @franz-wohlkoenig no activity for over a year. Suggesting to close this one.

@machadoug thanks for your PR! If you would like to get this in Joomla I recommend opening a new PR against the latest 4.0-dev branch.

@ghost
Copy link

ghost commented May 5, 2019

closed as stated above.

@ghost ghost closed this May 5, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants