Fix JavaScript in docs
This commit is contained in:
parent
afdf52b053
commit
2c21d3b3fa
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ The creation of the `BrowserWindow` is customizable in `WebContents`'s `new-wind
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
mainWindow.webContents.on('new-window', (event, url, frameName, disposition, options, additionalFeatures) => {
|
mainWindow.webContents.on('new-window', (event, url, frameName, disposition, options, additionalFeatures) => {
|
||||||
if (url.endsWith("modal.html")) {
|
if (url.endsWith('modal.html')) {
|
||||||
// open window as modal
|
// open window as modal
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
Object.assign(options, {
|
Object.assign(options, {
|
||||||
|
@ -61,7 +61,7 @@ mainWindow.webContents.on('new-window', (event, url, frameName, disposition, opt
|
||||||
height: 100
|
height: 100
|
||||||
})
|
})
|
||||||
modal = new BrowserWindow(options)
|
modal = new BrowserWindow(options)
|
||||||
modal.loadURL(url)
|
|
||||||
event.newGuest = modal
|
event.newGuest = modal
|
||||||
}
|
}
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue