1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +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:
Paweł Spychalski 2023-12-26 20:50:16 +01:00 committed by GitHub
commit 8c39e7267b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,9 +122,13 @@ $(document).ready(function () {
//Get saved size and position
chrome.storage.local.get('windowSize', function (result) {
if (result.windowSize) {
if (result.windowSize.height <= window.screen.availHeight)
win.height = result.windowSize.height;
if (result.windowSize.width <= window.screen.availWidth)
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;
}
});