mirror of
https://github.com/twbs/bootstrap.git
synced 2025-10-08 00:04:11 -04:00
Doc: fix 'Events' JS example
This commit is contained in:
parent
96b0fd67f5
commit
9129e4a073
@ -118,9 +118,7 @@ All infinitive events provide [`preventDefault()`](https://developer.mozilla.org
|
|||||||
const myModal = document.querySelector('#myModal')
|
const myModal = document.querySelector('#myModal')
|
||||||
|
|
||||||
myModal.addEventListener('show.bs.modal', event => {
|
myModal.addEventListener('show.bs.modal', event => {
|
||||||
if (!data) {
|
return event.preventDefault() // stops modal from being shown
|
||||||
return event.preventDefault() // stops modal from being shown
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user