[pLog-svn] r5754 - in plog/trunk/js: location ui

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Jul 29 17:41:38 EDT 2007


Author: oscar
Date: 2007-07-29 17:41:38 -0400 (Sun, 29 Jul 2007)
New Revision: 5754

Modified:
   plog/trunk/js/location/location.js
   plog/trunk/js/ui/contentoverlay.js
Log:
some additional cleanup when done with the maps: call GUnload when hiding the panel and call Panel.destroy() to make sure that the DOM is cleaned up.


Modified: plog/trunk/js/location/location.js
===================================================================
--- plog/trunk/js/location/location.js	2007-07-29 21:24:12 UTC (rev 5753)
+++ plog/trunk/js/location/location.js	2007-07-29 21:41:38 UTC (rev 5754)
@@ -106,6 +106,8 @@
 {
 	url = '?op=adminLocationDisplay&locId=' + locId;
 	
+	Lifetype.UI.ContentOverlay.Events.hideOverlay.subscribe( function() { GUnload(); });
+	
 	this.o = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), url );
 	// and bind it to the onclick event
 	this.o.show();
@@ -116,6 +118,9 @@
 Lifetype.UI.Location.Selector.blogDisplay = function( url )
 {	
 	this.o = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), url );
+	
+	Lifetype.UI.ContentOverlay.Events.hideOverlay.subscribe( function() { GUnload(); });	
+	
 	// and bind it to the onclick event
 	this.o.show();
 	

Modified: plog/trunk/js/ui/contentoverlay.js
===================================================================
--- plog/trunk/js/ui/contentoverlay.js	2007-07-29 21:24:12 UTC (rev 5753)
+++ plog/trunk/js/ui/contentoverlay.js	2007-07-29 21:41:38 UTC (rev 5754)
@@ -50,6 +50,9 @@
  */
 Lifetype.UI.ContentOverlay.Events.dataLoaded = new YAHOO.util.CustomEvent('dataLoaded');
 
+Lifetype.UI.ContentOverlay.Events.hideOverlay = new YAHOO.util.CustomEvent('hideOverlay');
+Lifetype.UI.ContentOverlay.Events.destroyOverlay = new YAHOO.util.CustomEvent('destroyOverlay');
+
 Lifetype.UI.ContentOverlay.prototype.hide = function()
 {
 	// this is doing nothing now, but I am planning to perform a check here 
@@ -78,6 +81,22 @@
 	return( false );	
 }
 
+Lifetype.UI.ContentOverlay.prototype.hide = function()
+{
+	Lifetype.UI.ContentOverlay.Events.hideOverlay.fire();
+	Lifetype.UI.ContentOverlay.superclass.hide.call( this );
+	
+	// we should clean up the DOM after we're done with the panel, otherwise IE
+	// and Safari seem to ahve problems showing it again
+	this.destroy();
+}
+
+Lifetype.UI.ContentOverlay.prototype.destroy = function()
+{
+	Lifetype.UI.ContentOverlay.Events.destroyOverlay.fire();
+	Lifetype.UI.ContentOverlay.superclass.destroy.call( this );
+}
+
 /**
  * Processes all the anchors whose "rel" attribute is set to
  * "overlay". Can be called as static



More information about the pLog-svn mailing list