解决login.html focus()问题

This commit is contained in:
life
2015-04-01 20:56:02 +08:00
parent 78640d2a17
commit b1b28ee4d7
3 changed files with 11 additions and 6 deletions

View File

@@ -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() {

View File

@@ -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();

View File

@@ -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();