mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 16:45:21 +00:00
2.3 released
This commit is contained in:
23
main.js
23
main.js
@@ -116,7 +116,19 @@ function removeEvents (win) {
|
||||
win.removeAllListeners('close');
|
||||
}
|
||||
|
||||
function close (e, force) {
|
||||
console.log('close:', force);
|
||||
if (mainWindow) {
|
||||
mainWindow.hide();
|
||||
e && e.preventDefault();
|
||||
mainWindow.webContents.send('closeWindow');
|
||||
} else {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
|
||||
function bindEvents (win) {
|
||||
mainWindow = win;
|
||||
|
||||
// Emitted when the window is closed.
|
||||
win.on('closed', function() {
|
||||
@@ -138,17 +150,6 @@ function bindEvents (win) {
|
||||
if(win && win.webContents)
|
||||
win.webContents.send('blurWindow');
|
||||
});
|
||||
|
||||
function close (e, force) {
|
||||
console.log('close:', force);
|
||||
if (win) {
|
||||
win.hide();
|
||||
e && e.preventDefault();
|
||||
win.webContents.send('closeWindow');
|
||||
} else {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
|
||||
// 以前的关闭是真关闭, 现是是假关闭了
|
||||
// 关闭,先保存数据
|
||||
|
Reference in New Issue
Block a user