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
  • !1221

Automatically set Tooltip z-index according to the parent's z-index

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/pokonski/js-zindex into 2.0-wip Jan 25, 2012
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: pokonski

I went ahead and made some changes to fix the z-indexes as described in #1109 (closed). This code automatically sets increased z-index of its parent (if any parent has z-index set at all) to make Tooltips and Popovers visible in .modal.

I didn't want to restrict it to a class name so I filter parents by finding the closest one with that CSS attribute set. This way it will work not only in modals but with other elements users might create.

Works fine on Opera/Chrome/Firefox. The only concern might be performance, but in Bootstrap docs even in the worst scenario (Tooltips are not in modals, therefore filter checks parents up to <html>) this is only 8 elements to check => no visible slow-downs.

@fat, can you take a look? Demo => http://okonski.org/bootstrap-zindex/docs/javascript.html#modals

EDIT: Seems to work just fine for fixed navbars, too! :)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pokonski/js-zindex