Destroy Stack!

kscheirer - July 21, 2009 - 19:05
Project:Popups API (Ajax Dialogs)
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

When using the popup Stack, I would like to have a new popup take over and be the only popup, either by deleting all other popups or by replacing the content of the existing popup.

I think this may already be possible with creative use of an updateMethod = callback and having the callback go through and call a close function on each existing other popups. Any advice towards this would be appreciated :)

#1

newtodrupal21 - September 30, 2009 - 06:58

You can add Popups.close(); in popup.js when it calls the push function. This way everytime a new pop up is called it will close the already open ones. See the piece of code below.
I have added popups.close() just before the push method.

/**
* Manage the page wide popupStack.
*/
Popups.push = function(popup) {
Popups.close(); // inserted this line of code
Popups.popupStack.push(popup);
};

I am very new to drupal and have not tested this for any further issues that might arise coz of this. It worked out well for me.

#2

yountod - December 8, 2009 - 00:05

That seems to kill the overlay? I'm running IE and applied the patch to close the overlay, that might have something to do with it.

 
 

Drupal is a registered trademark of Dries Buytaert.