You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/References/Window.md
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -483,29 +483,29 @@ See example code of [`win.close(true)` above](#wincloseforce) for the usage of `
483
483
484
484
## Event: closed
485
485
486
-
The `closed` event is emitted after corresponding window is closed. Normally you'll not be able to get this event since after the window is closed all js objects will be released. But it's useful if you're listening this window's events in another window, whose objects will not be released.
486
+
The `closed` event is emitted after the corresponding window is closed. Normally you will not be able to get this event since after the window is closed all js objects will be released. But it is useful when listening to the window's events in another window, whose objects will not be released.
487
487
488
488
```javascript
489
489
// Open a new window.
490
-
nw.Window.open('popup.html', {}, function(win) {
491
-
// Release the 'win' object here after the new window is closed.
492
-
win.on('closed', function() {
493
-
win =null;
494
-
});
495
-
496
-
// Listen to main window's close event
497
-
nw.Window.get().on('close', function() {
498
-
// Hide the window to give user the feeling of closing immediately
499
-
this.hide();
490
+
nw.Window.open('popup.html', {}, function (win) {
491
+
// Release the 'win' object here after the new window is closed.
492
+
win.on('closed', function () {
493
+
win =null;
494
+
});
500
495
501
-
// If the new window is still open then close it.
502
-
if (win !=null)
503
-
win.close(true);
504
-
505
-
// After closing the new window, close the main window.
506
-
this.close(true);
507
-
});
496
+
// Listen to main window's close event
497
+
nw.Window.get().on('close', function () {
498
+
// Hide the window to give user the feeling of closing immediately
499
+
this.hide();
508
500
501
+
// If the new window is still open then close it.
502
+
if (win !==null) {
503
+
win.close(true);
504
+
}
505
+
506
+
// After closing the new window, close the main window.
0 commit comments