Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !7299

Allow dynamic target definition.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/alexkalderimis/dynamic-tabs into 3.0.0-wip Mar 16, 2013
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: alexkalderimis

Please merge this pull request to allow users to create tab pane systems where pane selectors are unknown at tab creation time.

Currently tabs expect jquery selectors only for tab pane target definition. This makes it difficult for dynamic tab construction where ids and thus selectors cannot be reliably generated. Also from an efficiency stand-point, repeated dom queries could be avoided where the target can be computed in advance.

This commit allows a tab a have its target defined using the data api, while giving precedence to the data-target element attribute for target definition. This in no way conflicts with the current behaviour of tabs, and opens up powerful avenues for extension with autogenerated tab systems.

My use case is an embedded widget which constructs tab panes as part of a dialogue process. As many widgets could be instantiated on each page, ids are not feasible for me to implement without some system for generating globally unique element ids. Simply using the data api is much simpler way of addressing this issue in a backwards compatible fashion.

Tests are included in the bootstrap-tabs unit test section.

A duplicate test (probably a copy-paste error) was removed from the tabs unit test.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/alexkalderimis/dynamic-tabs