Skip to main content

Bug Tracker

Side navigation

Ticket #2879: event-props.diff
File event-props.diff, 1.2 KB (added by flesler, May 16, 2008 04:09AM UTC)
Index: event.js
===================================================================
--- event.js	(revision 5615)
+++ event.js	(working copy)
@@ -274,15 +274,16 @@
 		return val;
 	},
 
+	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "),
+
 	fix: function(event) {
 		if ( event[expando] == true )
 			return event;
 
 		// store a copy of the original event object
 		// and "clone" to set read-only properties
-		var originalEvent = event;
+		var originalEvent = event, props = this.props;
 		event = { originalEvent: originalEvent };
-		var props = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
 		for ( var i=props.length; i; i-- )
 			event[ props[i] ] = originalEvent[ props[i] ];

Download in other formats:

Original Format