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

Restrict processing of tab items to immediate children #21159

Closed
wants to merge 3 commits into from
Closed

Restrict processing of tab items to immediate children #21159

wants to merge 3 commits into from

Conversation

ryandemmer
Copy link
Contributor

@ryandemmer ryandemmer commented Jul 17, 2018

Summary of Changes

When creating a new tabset within an existing tabset, using JHtml::_('bootstrap.startTabSet') etc., the tab items of the new tabset will be appended to the existing "parent" tabset.

This PR changes the selector for the jQuery iterator so that only the immediate "tab-pane" children of the tab content div are targeted and not all "tab-pane" nodes in the content div.

Testing Instructions

This is difficult to test without creating a new component or heavily editing an existing one, but the issue can be seen in markup like this:

<?php echo JHtml::_('bootstrap.startTabSet', 'tabs');?>
	<?php echo JHtml::_('bootstrap.addTab', 'tabs', 'tabs-tab1', 'Tab1');?>
		<div class="row-fluid">
			<div class="tabbable tabs-left flex-column">
    			<?php echo JHtml::_('bootstrap.startTabSet', 'tabs-left1'); ?>
    				<?php echo JHtml::_('bootstrap.addTab', 'tabs-left1', 'tabs-left1-tab1', 'Left1');?>
                		<div class="row-fluid">
                    		<?php echo $this->loadTemplate('some_template'); ?>
                		</div>
            		<?php echo JHtml::_('bootstrap.endTab');?>
            	<?php echo JHtml::_('bootstrap.endTabSet'); ?>
    		</div>
		</div>
	<?php echo JHtml::_('bootstrap.endTab');?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>

Expected result

A new set of tabs is created inside the existing tabset.

Actual result

The "Left1" tab item is appended to the "tabs-tab1" set, below "Tab1"

Documentation Changes Required

None.

@@ -157,8 +157,7 @@
/** Tabs **/
if (tabs) {
$.each(tabs, function(index, value) {

$.each($('#' + index + 'Content').find('.tab-pane'), function(i, v) {
$('#' + index + 'Content').children('.tab-pane').each(function(i, v) {

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 4 tabs indent
Unexpected tab character no-tabs
Unexpected string concatenation prefer-template
Unexpected unnamed function func-names
Unexpected function expression prefer-arrow-callback
Missing space before function parentheses space-before-function-paren

@@ -158,7 +158,7 @@
if (tabs) {
$.each(tabs, function(index, value) {

$.each($('#' + index + 'Content').find('.tab-pane'), function(i, v) {
$('#' + index + 'Content').children('.tab-pane').each(function(i, v) {

Choose a reason for hiding this comment

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

Expected indentation of 8 spaces but found 4 tabs indent
Unexpected tab character no-tabs
Unexpected string concatenation prefer-template
Unexpected unnamed function func-names
Unexpected function expression prefer-arrow-callback
Missing space before function parentheses space-before-function-paren

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

@dgrammatiko is this still a problem in J4?

@ryandemmer
Copy link
Contributor Author

These scripts don't appear to be available / used anymore. Closing.

@ryandemmer ryandemmer closed this Oct 19, 2019
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

4 participants