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
  • Issues
  • #25220
Closed
Open
Issue created Jan 06, 2018 by Administrator@rootContributor

Allow anchor links to automatically load JS tabs

Created by: ucffool

Currently it's necessary to add a small junk of JS (created below) to activate NAV tabs/pills based on the anchor link provided on the tab/pill itself when a page is loaded. This is for deep linking to a tab/pill on a page. This feature request is to integrate this behaviour automatically as part of bootstrap v4 JS.

// Show appropriate pill based on #anchor in URL
var url = window.location.href;
if (url.indexOf("#") > 0){
var activeTab = url.substring(url.indexOf("#") + 1);
  $('.nav[role="tablist"] a[href="#'+activeTab+'"]').tab('show');
}
Assignee
Assign to
Time tracking