[richfaces-svn-commits] JBoss Rich Faces SVN: r5163 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Jan 7 15:26:33 EST 2008


Author: nbelaevski
Date: 2008-01-07 15:26:33 -0500 (Mon, 07 Jan 2008)
New Revision: 5163

Modified:
   trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-1841 back compatibility fix update

Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2008-01-07 20:25:07 UTC (rev 5162)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2008-01-07 20:26:33 UTC (rev 5163)
@@ -70,25 +70,6 @@
 
 ModalPanel.panels = new Array();
 
-A4J.AJAX.AddListener({
-	onafterajax: function(req, event, data) {
-		var i = 0;
-		while (i < ModalPanel.panels.length) {
-			var panel = ModalPanel.panels[i];
-
-			if (Element.isUninitialized(panel.markerId)) {
-				panel.destroy();
-
-				ModalPanel.panels.splice(i, 1);
-				//check all panels again. maybe we've removed parent of any panel just now
-				i = 0;
-			} else {
-				i++;
-			}
-		}
-	}
-});
-
 ModalPanel.Context = Class.create();
 ModalPanel.Context.prototype = {
 	initialize: function(modalPanel) {
@@ -127,7 +108,8 @@
 
 ModalPanel.prototype = {
 	initialize: function(id, options) {
-
+		this["rich:destructor"] = "destroy";
+	
 		this.markerId = $(id);
 
 		this.id = $(id + "Container");
@@ -209,7 +191,8 @@
 	},
 
 	destroy: function() {
-
+		ModalPanel.panels = ModalPanel.panels.without(this);
+		
         this.traverseSelects(true);
         
         this.parent = null;




More information about the richfaces-svn-commits mailing list