modified function openPopup() to get the image window in focus again if

it was not closed before (code contributed by andrea http://project.antville.org/20020730/108447)
This commit is contained in:
Tobi Schäfer 2002-07-30 06:39:49 +00:00
parent caa3f05e51
commit bc7b0254e0

View file

@ -1,8 +1,12 @@
var imgWindow = "";
function openPopup(img, width, height) {
if (img && width && height) {
width = Math.min(width + 36, 640);
height = Math.min(height + 30, 480);
var popUp = window.open(img,"popUp","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + width + ",height=" + height);
if (imgWindow.location && !imgWindow.closed)
imgWindow.close();
imgWindow = window.open(img, "imgWindow" + width + height, "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height);
imageWindow.focus();
}
return;
}