0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Update modal's show method to accept relatedTarget as an argument (#33300)

Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Anton 2021-03-16 08:49:52 +03:00 committed by GitHub
parent 99b2c0b390
commit af42557f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -892,6 +892,13 @@ Manually opens a modal. **Returns to the caller before the modal has actually be
myModal.show()
```
Also, you can pass a DOM element as an argument that can be received in the modal events (as the `relatedTarget` property).
```js
var modalToggle = document.getElementById('toggleMyModal') // relatedTarget
myModal.show(modalToggle)
```
#### hide
Manually hides a modal. **Returns to the caller before the modal has actually been hidden** (i.e. before the `hidden.bs.modal` event occurs).