Commit de712fa49a4aa44359ffa309191e9195926776f4
change settings from dash nesting to object nesting
mix irving committed on 9/4/2017, 9:21:23 PMParent: 57003379961d045ad830d7f296c7d85d38366021
Files changed
app/html/app.js | changed |
app/html/app.js | |||
---|---|---|---|
@@ -58,24 +58,29 @@ | |||
58 | 58 … | ||
59 | 59 … | addError(ev.error || ev) | |
60 | 60 … | }) | |
61 | 61 … | ||
62 | - window.addEventListener('resize', function(e){ | ||
63 | - var wc = electron.remote.getCurrentWebContents() | ||
64 | - wc && wc.getZoomFactor((zf) => { | ||
65 | - api.settings.sync.set({ | ||
66 | - 'electron-zoomFactor': zf, | ||
67 | - 'electron-windowBounds': electron.remote.getCurrentWindow().getBounds() | ||
68 | - }) | ||
69 | - }) | ||
62 … | + // TODO - extract this to keep patch-lite isolated from electron | ||
63 … | + window.addEventListener('resize', () => { | ||
64 … | + var wc = electron.remote.getCurrentWebContents() | ||
65 … | + wc && wc.getZoomFactor((zf) => { | ||
66 … | + api.settings.sync.set({ | ||
67 … | + electron: { | ||
68 … | + zoomFactor: zf, | ||
69 … | + windowBounds: electron.remote.getCurrentWindow().getBounds() | ||
70 … | + } | ||
71 … | + }) | ||
72 … | + }) | ||
70 | 73 … | }) | |
71 | 74 … | ||
72 | - var zoomFactor = api.settings.sync.get('electron-zoomFactor') | ||
75 … | + var zoomFactor = api.settings.sync.get('electron.zoomFactor') | ||
73 | 76 … | if (zoomFactor) | |
74 | - electron.remote.getCurrentWebContents().setZoomFactor(zoomFactor) | ||
75 | - var bounds = api.settings.sync.get('electron-windowBounds') | ||
77 … | + electron.remote.getCurrentWebContents().setZoomFactor(zoomFactor) | ||
78 … | + | ||
79 … | + var bounds = api.settings.sync.get('electron.windowBounds') | ||
76 | 80 … | if (bounds) | |
77 | - electron.remote.getCurrentWindow().setBounds(bounds) | ||
81 … | + electron.remote.getCurrentWindow().setBounds(bounds) | ||
82 … | + /////////////////// | ||
78 | 83 … | ||
79 | 84 … | return App | |
80 | 85 … | } | |
81 | 86 … | } |
Built with git-ssb-web