Author: mfang
Date: 2009-05-18 12:45:25 +0200 (Mon, 18 May 2009)
New Revision: 35235
Modified:
CMSContainer/trunk/CMSContainer/cmsc/utilities/src/webapp/js/window.js
Log:
CMSC-1124 open all popups on the same screen as the 'main' application
Modified: CMSContainer/trunk/CMSContainer/cmsc/utilities/src/webapp/js/window.js
===================================================================
--- CMSContainer/trunk/CMSContainer/cmsc/utilities/src/webapp/js/window.js
2009-05-18 08:13:21 UTC (rev 35234)
+++ CMSContainer/trunk/CMSContainer/cmsc/utilities/src/webapp/js/window.js
2009-05-18 10:45:25 UTC (rev 35235)
@@ -3,9 +3,9 @@
if (!width) {w = 750;} else { w = width; }
if (!height) {h = 550;} else { h = height; }
if (!url) {url = "";}
- var options = getPopupPositionProps(w, h) +
',scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes';
+ var options = getPopupPositionProps(w, h) +
',scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes';
var w = window.open(url, windowName, options);
- w.focus();
+ w.focus();
return false;
}
@@ -25,7 +25,7 @@
} else if (document.documentElement &&
document.documentElement.clientWidth) {
width = document.documentElement.clientWidth;
} else {
- width = 863; // default value for 1024x786
+ width = 863; // default value for 1024x768
}
return width;
}
@@ -43,10 +43,10 @@
height = win.innerHeight;
} else if (win.document.body.clientHeight) {
height = win.document.body.clientHeight;
- } else if (document.documentElement &&
document.documentElement.clientWidth) {
+ } else if (document.documentElement &&
document.documentElement.clientHeight) {
height = document.documentElement.clientHeight;
} else {
- height = 543; // default value for 1024x786
+ height = 543; // default value for 1024x768
}
return height;
}
@@ -58,10 +58,12 @@
var width;
if(win.document.layers || (win.document.getElementById &&
!win.document.all)){
width = win.outerWidth;
- } else if(win.document.all){
+ } else if(win.document.all && win.document.body.clientWidth){
width = win.document.body.clientWidth;
+ } else if (win.document.all && document.documentElement &&
document.documentElement.clientWidth){
+ width = document.documentElement.clientWidth;
} else {
- width = 1024; // default value for 1024x786
+ width = 1024; // default value for 1024x768
}
return width;
}
@@ -73,10 +75,12 @@
var height;
if(win.document.layers || (win.document.getElementById &&
!win.document.all)){
height = win.outerHeight;
- } else if(win.document.all){
+ } else if(win.document.all && win.document.body.clientHeight){
height = win.document.body.clientHeight;
+ } else if (win.document.all && document.documentElement &&
document.documentElement.clientHeight){
+ width = document.documentElement.clientHeight;
} else {
- height = 786; // default value for 1024x786
+ height = 768; // default value for 1024x768
}
return height;
}
@@ -110,10 +114,10 @@
var screenMinX = screen.availLeft != null ? screen.availLeft : 0;
var screenMinY = screen.availTop != null ? screen.availTop : 0;
- var screenMaxX = screen.availWidth != null ? screen.availWidth : 0;
- var screenMaxY = screen.availHeight != null ? screen.availHeight : 0;
+ var screenMaxX = screen.availWidth != null ? screen.availWidth : 1024;
// default value for 1024x768
+ var screenMaxY = screen.availHeight != null ? screen.availHeight : 768;
// default value for 1024x768
- var x = openerx + Math.round((openerw - width) / 2);
+ var x = openerx + Math.round((openerw - width) / 2);
var y = openery + Math.round((openerh - height) / 2);
// adjust to right of screen
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs