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

Fix up the beez3 template.js #20225

Merged
merged 4 commits into from
Dec 5, 2019

Conversation

okonomiyaki3000
Copy link
Contributor

Pull Request for Issue # .

Summary of Changes

Don't use unnecessary closure, just use jQuery ready function.
Use javsacript strict mode
use event delegation where possible
Make tooltips and button groups work properly with repeatable subforms

Testing Instructions

Use beez3.
Create a page with a repeatable subform containing a radiobutton field with the btn-group class.

Expected result

Expect newly created rows to initialize btn-groups properly.

Actual result

Yes, it works.

Documentation Changes Required

No.

Don't use unnecessary closure, just use jQuery ready function
Use javascript strict mode
use event delegation where possible
Make tooltips and button groups work properly with repeatable subforms
@okonomiyaki3000
Copy link
Contributor Author

This basically an alternative to #19722 with additional improvements and cleanup.


$(document).on('click', ".btn-group label:not(.active)", function() {
var $label = $(this);
var $input = $('#' + label.attr('for'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing "$" before "label". Must be var $input = $('#' + $label.attr('for'));.

@ReLater
Copy link
Contributor

ReLater commented Apr 28, 2018

I have tested this item 🔴 unsuccessfully on 8157f49

Fails with error:
ReferenceError: label is not defined template.js:14:8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20225.

jQuery collections prefixed with '$'
@ReLater
Copy link
Contributor

ReLater commented Apr 29, 2018

I have tested this item ✅ successfully on db22fd0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20225.

@ReLater
Copy link
Contributor

ReLater commented Apr 29, 2018

Just as a hint for testers (Beez doesn't load Bootstrap css always):
Deactivate this line before tests:
https://github.com/joomla/joomla-cms/blob/staging/templates/beez3/index.php#L41

to get the buttons styled correctly. Subforms don't look nice then but it is sufficient to test the concern of this pr.

@ghost ghost added the J3 Issue label Apr 5, 2019
@ghost ghost removed the J3 Issue label Apr 19, 2019
@SharkyKZ
Copy link
Contributor

I have tested this item ✅ successfully on db22fd0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20225.

@SharkyKZ
Copy link
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20225.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 11, 2019
@HLeithner
Copy link
Member

It took some time to merge but thanks for you fix.

@HLeithner HLeithner merged commit aa42ef1 into joomla:staging Dec 5, 2019
@HLeithner HLeithner added this to the Joomla! 3.9.14 milestone Dec 5, 2019
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 5, 2019
@okonomiyaki3000 okonomiyaki3000 deleted the beez3-template-js branch December 6, 2019 01:17
@wilsonge wilsonge mentioned this pull request Mar 4, 2020
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

6 participants