mirror of
https://github.com/leanote/desktop-app.git
synced 2026-01-21 01:13:57 +08:00
解决login.html focus()问题
This commit is contained in:
@@ -72,10 +72,14 @@ if(process.platform != 'darwin') {
|
||||
<script>
|
||||
var gui = require('nw.gui');
|
||||
var win = gui.Window.get();
|
||||
win.setAlwaysOnTop(true);
|
||||
// alert(win);
|
||||
// win.setAlwaysOnTop(true);
|
||||
// win.focus();
|
||||
// gui.Window.focus();
|
||||
try {
|
||||
// win.focus();
|
||||
window.focus();
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('.tool-close, .tool-close-blur').click(function() {
|
||||
|
||||
@@ -21,7 +21,7 @@ $(function() {
|
||||
var isMacP = isMac();
|
||||
$('.tool-close, .tool-close-blur').click(function() {
|
||||
// mac下关闭才是隐藏
|
||||
if(isMacP && location.href.indexOf('login.html') == -1 ) {
|
||||
if(isMacP) {
|
||||
win.hide();
|
||||
} else {
|
||||
win.close();
|
||||
|
||||
@@ -1384,7 +1384,7 @@ function switchAccount() {
|
||||
SyncService.stop();
|
||||
// location.href = 'login.html';
|
||||
if(isMac()) {
|
||||
gui.Window.open('login.html', {
|
||||
var win2 = gui.Window.open('login.html', {
|
||||
"icon": "public/images/logo/leanote_icon_blue.png",
|
||||
frame: false, toolbar: false, resizable: false,
|
||||
transparent: true,
|
||||
@@ -1392,7 +1392,7 @@ function switchAccount() {
|
||||
max_width: 278
|
||||
});
|
||||
} else {
|
||||
gui.Window.open('login.html', {
|
||||
var win2 = gui.Window.open('login.html', {
|
||||
"icon": "public/images/logo/leanote_icon_blue.png",
|
||||
frame: true, toolbar: false, resizable: false,
|
||||
transparent: false,
|
||||
@@ -1401,6 +1401,7 @@ function switchAccount() {
|
||||
max_width: 278
|
||||
});
|
||||
}
|
||||
// win2.focus();
|
||||
// w.focus();
|
||||
// gui.Window.close();
|
||||
win.close();
|
||||
|
||||
Reference in New Issue
Block a user