Merge pull request #371 from m-bene/resizeWindows

Reduce window size to exclude task bar area
pull/527/head
Andrew Bauer 2014-10-09 14:46:46 -05:00
commit 7ea003441d
2 changed files with 34 additions and 0 deletions

View File

@ -71,6 +71,23 @@ var popupSizes = {
var popupOptions = "resizable,scrollbars,status=no";
function checkSize() {
if (window.outerHeight) {
var w = window.outerWidth;
var prevW = w;
var h = window.outerHeight;
var prevH = h;
if (h > screen.availHeight)
h = screen.availHeight;
if (w > screen.availWidth)
w = screen.availWidth;
if (w != prevW || h != prevH)
window.resizeTo(w,h);
}
}
window.addEvent( 'domready', checkSize);
// Deprecated
function newWindow( url, name, width, height )
{

View File

@ -71,6 +71,23 @@ var popupSizes = {
var popupOptions = "resizable,scrollbars,status=no";
function checkSize() {
if (window.outerHeight) {
var w = window.outerWidth;
var prevW = w;
var h = window.outerHeight;
var prevH = h;
if (h > screen.availHeight)
h = screen.availHeight;
if (w > screen.availWidth)
w = screen.availWidth;
if (w != prevW || h != prevH)
window.resizeTo(w,h);
}
}
window.addEvent( 'domready', checkSize);
// Deprecated
function newWindow( url, name, width, height )
{