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

Active Tab parameter #548

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Staples1887
Copy link
Contributor

Description of the Change

  • Added activeElement variable to PodeCyclingElement set from data
  • Changed check for if element is active to include a check of activeElement variable on PodeCyclingChildElement and PodeTabs
  • Changed PodeTab to check this.active rather than this.child.isfirst
  • Added Active Tab Parameter to New-PodeWebTabs.
  • Added Example for testing.

Related Issue

#542

Examples

$tabs = New-PodeWebTabs -ActiveTab "Tab2" -Tabs @(
    New-PodeWebTab -Name Tab1 -Content @(
        New-PodeWebContainer -Content @(
            New-PodeWebText -Value 'Hello World'
        )
    )
    New-PodeWebTab -Name Tab2 -Content @(
        New-PodeWebContainer -Content @(
            New-PodeWebText -Value 'Hello There'
        )
    )
    New-PodeWebTab -Name Tab3 -Content @(
        New-PodeWebContainer -Content @(
            New-PodeWebText -Value 'Hi!'
        )
    )
)

Additional Context

While the change effects PodeCyclingElement and PodeCyclingChildElement if the active element is not past then it defaults to the previous behaviour, first child is active.

@Staples1887 Staples1887 marked this pull request as ready for review February 12, 2024 09: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