You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ja...@apache.org on 2007/05/08 19:09:32 UTC

svn commit: r536254 - /incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Author: janne
Date: Tue May  8 10:09:31 2007
New Revision: 536254

URL: http://svn.apache.org/viewvc?view=rev&rev=536254
Log:
moved Wicket.Drag.fixEvent to Wicket.fixEvent because it doesn't have anything to do with dragging


Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?view=diff&rev=536254&r1=536253&r2=536254
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js Tue May  8 10:09:31 2007
@@ -1328,28 +1328,25 @@
  * Prevent event from bubbling up in the element hierarchy.
  */
 Wicket.stopEvent = function(e) {
-	if (typeof(e) == "undefined")
-		e = window.event;
-		
+	e=Wicket.fixEvent(e);		
 	e.cancelBubble = true;
 	if (e.stopPropagation)
 		e.stopPropagation();
 }
 
+/**
+ * If no event is given as argument (IE), window.event is returned. 
+ */
+Wicket.fixEvent = function(e) {
+	if (typeof e == 'undefined') 
+		e = window.event;
+	return e;		
+}
 
 /**
  * Flexible dragging support.
  */
 Wicket.Drag = {
-
-	/**
-	 * If no event is given as argument (IE), window.event is returned. 
-	 */
-	fixEvent: function(e) {
-		if (typeof e == 'undefined') 
-			e = window.event;
-		return e;		
-	},
 	
 	/**
 	 * Initializes the dragging on the specified element.
@@ -1372,7 +1369,7 @@
 		// set the mousedown handler 
 		element.onmousedown = function(e) {			
 			
-			e = Wicket.Drag.fixEvent(e);
+			e = Wicket.fixEvent(e);
 	
 			// HACK - for safari stopPropagation doesn't work well because
 			// it also prevents scrollbars and form components getting the
@@ -1424,7 +1421,7 @@
 	 * @param {Event} e
 	 */	
 	mouseMove: function(e) {
-		e = Wicket.Drag.fixEvent(e);
+		e = Wicket.fixEvent(e);
 		var o = Wicket.Drag.current;
 
 		// this happens sometimes in Safari 
@@ -1455,7 +1452,7 @@
 	 * @param {Event} e
 	 */	
 	mouseUp: function(e) {		
-		e = Wicket.Drag.fixEvent(e);
+		e = Wicket.fixEvent(e);
 		var o = Wicket.Drag.current;
 		
 		o.onDragEnd(o);		
@@ -1549,12 +1546,7 @@
 
 	setFocus: function(event)
 	{ 
-		// IE doesn't pass event into the parameter
-		// don't think this is needed for us because of Function.prototype.bind(element)?
-	    if ( !event )
-	    {
-	        event = window.event;
-	    }
+		event = Wicket.fixEvent(event);
 	
 	    // IE doesn't have the property "target".
 	    // Use "srcElement" instead.