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:
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
|
||||
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;
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue