mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 04:11:39 +02:00
Doc: fix 'Events' JS example
This commit is contained in:
committed by
Mark Otto
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
|
||||||
}
|
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user