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

Button that triggered the modal is now passed to 'shown' and 'show' as event.relatedTarget

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ryan-endacott/2.3.0-wip into 2.3.0-wip Feb 07, 2013
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: ryan-endacott

When a modal is triggered by a button, the button is now passed as a relatedTarget to the 'shown' event as mentioned in #6159 (closed).

Also added show event as referenced in #6205 (closed)

Ex:

$('#myModal').on('shown', function (e) {
  // e.relatedTarget is the element that triggered the modal
})

Tested on IE9, Firefox 14, and Chrome 23.

Resubmit of #6173. I took Fat's suggestion: The source button is now passed through event.relatedTarget.

Now it is a resubmit of #6425 against 2.3.0-wip as per Fat's suggestion. If there is something I have done wrong or a different branch to commit to please let me know :) Thanks!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ryan-endacott/2.3.0-wip