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

Index sub-tab name more fixes, and first tab CSS class fix #97

Closed
wants to merge 2 commits into from
Closed

Index sub-tab name more fixes, and first tab CSS class fix #97

wants to merge 2 commits into from

Conversation

james-cnz
Copy link
Contributor

Recently there was the change
Fix the index sub-tab name when childs are hidden
to address the issue
#92 Text in first child tab should always inherit from parent tab
I think there are still some problems remaining though.

When the code looks back through sections to find the previous first-level section, it ignores sections set as second-level, except section 0 (which will always be first-level regardless of setting). I think this is mostly right, but if section 0 is visualised before the tabs, then it should also not ignore the first visible section after section 0 (this will also always be first-level regardless of setting). Also, when the code looks back, it doesn't ignore hidden (first-level) sections, which I think it should. To fix these, instead of looking back to find the previous first-level section, I have used the approach of remembering the most recent first-level section. I have changed a nested if statement into a single check to avoid duplicate code (indenting is fixed in a separate change, to make the initial change more readable).

The code to determine when an index tab is selected still assumes the previous section is the parent. To fix this, I have referred to the previously found parent section.

Unrelated, but I also noticed tabs' CSS class, as set in $specialstyle has tab_level_{$level}, where $level is the level setting, not accounting for exceptions (section 0, or first following section if section 0 is visualised before the tabs). To fix this, I have moved the check count($tabs) == 0 earlier.

@james-cnz
Copy link
Contributor Author

Ignore this. I've started looking at addressing #83, which makes this irrelevant.

@james-cnz james-cnz mentioned this pull request Mar 1, 2021
@james-cnz james-cnz closed this Mar 1, 2021
@james-cnz
Copy link
Contributor Author

I've suggested #107 instead of #98, so this is relevant again.

@james-cnz james-cnz reopened this Oct 12, 2021
@james-cnz
Copy link
Contributor Author

Here's a screenshot of problems:
index_tab

@james-cnz james-cnz mentioned this pull request Nov 20, 2021
@james-cnz
Copy link
Contributor Author

I think this is mostly solved now.

@james-cnz james-cnz closed this Nov 26, 2021
@james-cnz james-cnz deleted the index_tab_2 branch September 27, 2022 22:18
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.

1 participant