mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 20:35:19 +03:00
Merge pull request #1847 from sensei-hacker/window_position_sanity
Handle monitor changes by not making the window larger than the screen
This commit is contained in:
commit
8c39e7267b
1 changed files with 8 additions and 4 deletions
12
main.js
12
main.js
|
@ -122,10 +122,14 @@ $(document).ready(function () {
|
||||||
//Get saved size and position
|
//Get saved size and position
|
||||||
chrome.storage.local.get('windowSize', function (result) {
|
chrome.storage.local.get('windowSize', function (result) {
|
||||||
if (result.windowSize) {
|
if (result.windowSize) {
|
||||||
win.height = result.windowSize.height;
|
if (result.windowSize.height <= window.screen.availHeight)
|
||||||
win.width = result.windowSize.width;
|
win.height = result.windowSize.height;
|
||||||
win.x = result.windowSize.x;
|
if (result.windowSize.width <= window.screen.availWidth)
|
||||||
win.y = result.windowSize.y;
|
win.width = result.windowSize.width;
|
||||||
|
if (result.windowSize.x >= window.screen.availLeft)
|
||||||
|
win.x = result.windowSize.x;
|
||||||
|
if (result.windowSize.y >= window.screen.availTop)
|
||||||
|
win.y = result.windowSize.y;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue