mirror of https://github.com/docker/docs.git
Fix window size file loading on windows
Signed-off-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
parent
246990d5d1
commit
45afe72962
|
|
@ -16,7 +16,6 @@
|
|||
"test": "jest -c jest-unit.json",
|
||||
"integration": "jest -c jest-integration.json",
|
||||
"release": "grunt release",
|
||||
"release-mac": "grunt release-mac",
|
||||
"lint": "jsxhint src"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
|
|
|
|||
|
|
@ -8,18 +8,17 @@ import os from 'os';
|
|||
import path from 'path';
|
||||
import child_process from 'child_process';
|
||||
|
||||
var isWin = process.platform === 'win32';
|
||||
|
||||
process.env.NODE_PATH = path.join(__dirname, 'node_modules');
|
||||
process.env.RESOURCES_PATH = path.join(__dirname, '/../resources');
|
||||
if (!isWin) {
|
||||
if (process.platform !== 'win32') {
|
||||
process.env.PATH = '/usr/local/bin:' + process.env.PATH;
|
||||
}
|
||||
|
||||
var size = {}, settingsjson = {};
|
||||
try {
|
||||
size = JSON.parse(fs.readFileSync(path.join(process.env[isWin ? 'USERPROFILE' : 'HOME'], 'Library', 'Application\ Support', 'Kitematic', 'size')));
|
||||
size = JSON.parse(fs.readFileSync(path.join(app.getPath('userData'), 'size')));
|
||||
} catch (err) {}
|
||||
|
||||
try {
|
||||
settingsjson = JSON.parse(fs.readFileSync(path.join(__dirname, 'settings.json'), 'utf8'));
|
||||
} catch (err) {}
|
||||
|
|
|
|||
|
|
@ -62,9 +62,6 @@ module.exports = {
|
|||
// TODO: fix me for windows 7
|
||||
return 'Documents';
|
||||
},
|
||||
supportDir: function () {
|
||||
return app.getPath('userData');
|
||||
},
|
||||
CommandOrCtrl: function () {
|
||||
return this.isWindows() ? 'Ctrl' : 'Command';
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import metrics from './MetricsUtil';
|
|||
var WebUtil = {
|
||||
addWindowSizeSaving: function () {
|
||||
window.addEventListener('resize', function () {
|
||||
fs.writeFileSync(path.join(util.supportDir(), 'size'), JSON.stringify({
|
||||
fs.writeFileSync(path.join(app.getPath('userData'), 'size'), JSON.stringify({
|
||||
width: window.outerWidth,
|
||||
height: window.outerHeight
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in New Issue