[richfaces-svn-commits] JBoss Rich Faces SVN: r4851 - branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Dec 14 09:20:46 EST 2007


Author: maksimkaszynski
Date: 2007-12-14 09:20:46 -0500 (Fri, 14 Dec 2007)
New Revision: 4851

Modified:
   branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
http://jira.jboss.com/jira/browse/RF-1626

Modified: branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
--- branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js	2007-12-14 14:20:39 UTC (rev 4850)
+++ branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js	2007-12-14 14:20:46 UTC (rev 4851)
@@ -1,18 +1,6 @@
 if (!window.Richfaces) window.Richfaces = {};
 Richfaces.ContextMenu = Class.create();
 
-Array.prototype.invock = function(method) {
-	var args = $A(arguments).slice(1);
-	var a = [];
-	
-	for(var i = 0; i < this.length; i++) {
-		var each = this[i];
-		a[i] = each[method].apply(each,args);
-	}
-	
-	return a;
-}
-
 Richfaces.ContextMenu.prototype = {
 	
 	initialize: function(id, evaluator, options) {
@@ -70,9 +58,11 @@
 	
 	destroy: function() {
 		var div = $(this.id + ":_auto_created");
+		Richfaces.infernalCachePurge(div);
 		if (div) {
 			div.parentNode.removeChild(div);
 		}
+		
 	},
 	
 	isNewContext: function(context) {
@@ -101,8 +91,22 @@
 };
 
 Richfaces.enableDefaultHandler = function(event) {
-	if (event.startsWith('on')) {
-		event = event.substr(2);
+	if (event.startsWith('on')) {
+	event = event.substr(2);
 	}
 	Event.stopObserving(document, event, Event.stop);
 };
+
+
+Richfaces.infernalCachePurge = function(root) {
+	if (root) {
+		if (root._eventID) {
+			Event.stopObserving(root);
+		}
+		var child = root.firstChild;
+		while(child) {
+			Richfaces.infernalCachePurge(child);
+			child = child.nextSibling;
+		}
+	}
+};
\ No newline at end of file




More information about the richfaces-svn-commits mailing list