mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-24 16:55:22 +03:00
fix error for require
This commit is contained in:
parent
db002fb1f5
commit
cacc4522c2
1 changed files with 27 additions and 23 deletions
50
main.js
50
main.js
|
@ -38,30 +38,34 @@ $(document).ready(function () {
|
|||
break;
|
||||
}
|
||||
|
||||
// Load native UI library
|
||||
var gui = require('nw.gui');
|
||||
var win = gui.Window.get();
|
||||
//Get saved size and position
|
||||
chrome.storage.local.get('windowSize', function (result) {
|
||||
if (result.windowSize) {
|
||||
win.height = result.windowSize.height;
|
||||
win.width = result.windowSize.width;
|
||||
win.x = result.windowSize.x;
|
||||
win.y = result.windowSize.y;
|
||||
}
|
||||
});
|
||||
|
||||
win.on('close', function() {
|
||||
//Save window size and position
|
||||
var currentWin = this;
|
||||
chrome.storage.local.set({'windowSize': {height: win.height, width: win.width, x: win.x, y: win.y}}, function() {
|
||||
// Notify that we saved.
|
||||
console.log('Settings saved');
|
||||
if (typeof require !== "undefined") {
|
||||
// Load native UI library
|
||||
var gui = require('nw.gui');
|
||||
var win = gui.Window.get();
|
||||
//Get saved size and position
|
||||
chrome.storage.local.get('windowSize', function (result) {
|
||||
if (result.windowSize) {
|
||||
win.height = result.windowSize.height;
|
||||
win.width = result.windowSize.width;
|
||||
win.x = result.windowSize.x;
|
||||
win.y = result.windowSize.y;
|
||||
}
|
||||
});
|
||||
this.hide(); // Pretend to be closed already
|
||||
console.log("We're closing...");
|
||||
this.close(true);
|
||||
});
|
||||
|
||||
win.on('close', function () {
|
||||
//Save window size and position
|
||||
var currentWin = this;
|
||||
chrome.storage.local.set({'windowSize': {height: win.height, width: win.width, x: win.x, y: win.y}}, function () {
|
||||
// Notify that we saved.
|
||||
console.log('Settings saved');
|
||||
});
|
||||
this.hide(); // Pretend to be closed already
|
||||
console.log("We're closing...");
|
||||
this.close(true);
|
||||
});
|
||||
} else {
|
||||
console.log('Not load require');
|
||||
}
|
||||
|
||||
chrome.storage.local.get('logopen', function (result) {
|
||||
if (result.logopen) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue