[vhffs-dev] [1403] Destroy all widgets when loading a new page to avoir ID clashes

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1403
Author:   beuss
Date:     2009-05-23 23:31:02 +0200 (Sat, 23 May 2009)

Log Message:
-----------
Destroy all widgets when loading a new page to avoir ID clashes

Modified Paths:
--------------
    branches/vhffs-design/vhffs-panel/js/vhffs/Common.js


Modified: branches/vhffs-design/vhffs-panel/js/vhffs/Common.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/vhffs/Common.js	2009-05-23 13:44:53 UTC (rev 1402)
+++ branches/vhffs-design/vhffs-panel/js/vhffs/Common.js	2009-05-23 21:31:02 UTC (rev 1403)
@@ -47,6 +47,11 @@
 					dojo.xhrGet({
 						url: href,
 						load: function(response) {
+							// Destroy all widgets to avoid conflicts
+							// if we load a page we already visited
+							if(typeof(dijit) != 'undefined' && dijit.registry) {
+								dijit.registry.forEach(function(w){ w.destroy(); });
+							}
 							vhffs.Common.loadContent(contentTarget, response);
 						}
 					});


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/