Fix JavaScript in docs

This commit is contained in:
Ryohei Ikegami 2017-03-19 20:09:52 +09:00
parent afdf52b053
commit 2c21d3b3fa

View file

@ -51,7 +51,7 @@ The creation of the `BrowserWindow` is customizable in `WebContents`'s `new-wind
```javascript
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
event.preventDefault()
Object.assign(options, {
@ -61,7 +61,7 @@ mainWindow.webContents.on('new-window', (event, url, frameName, disposition, opt
height: 100
})
modal = new BrowserWindow(options)
modal.loadURL(url)
event.newGuest = modal
}
})
```