ekhoo
10-04-2002, 06:15 AM
Hi,
I've a website that people click on thumbnails of photos to open a pop-up window that will display the photo. This has been working fine, and if they switch back to the main window and click on another photo, the previous pop-up window (if it's not closed) will be re-used. I used window.focus to bring it to the foreground.
Recently, I put in a feature to allow users to add the photo to their favorites list. This works by popping a new popup window with the confirmation. Once they click ok, this window closes. Now, if they go back to the main window and click on another photo, it doesn't re-use the popup, instead, it creates another new window.
In a nutshell:
MainWindow
--> PhotoViewer --> Favorites
When Favorites closes, it becomes:
MainWindow
--> PhotoViewer
--> PhotoViewer
etc.
my window open code is:
function launch(newURL, newName, newFeatures, orgName) {
var remote = open(newURL, newName, newFeatures);
if (remote.open == null)
remote.open = window;
remote.opener.name = orgName;
return remote;
}
How do I make it re-use the PhotoViewer window (if it's open)?
I've a website that people click on thumbnails of photos to open a pop-up window that will display the photo. This has been working fine, and if they switch back to the main window and click on another photo, the previous pop-up window (if it's not closed) will be re-used. I used window.focus to bring it to the foreground.
Recently, I put in a feature to allow users to add the photo to their favorites list. This works by popping a new popup window with the confirmation. Once they click ok, this window closes. Now, if they go back to the main window and click on another photo, it doesn't re-use the popup, instead, it creates another new window.
In a nutshell:
MainWindow
--> PhotoViewer --> Favorites
When Favorites closes, it becomes:
MainWindow
--> PhotoViewer
--> PhotoViewer
etc.
my window open code is:
function launch(newURL, newName, newFeatures, orgName) {
var remote = open(newURL, newName, newFeatures);
if (remote.open == null)
remote.open = window;
remote.opener.name = orgName;
return remote;
}
How do I make it re-use the PhotoViewer window (if it's open)?