Bug Tracker

Ticket #2879: event-props.diff

File event-props.diff, 1.2 KB (added by flesler, 12 years ago)
  • event.js

     
    274274                return val;
    275275        },
    276276
     277        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(" "),
     278
    277279        fix: function(event) {
    278280                if ( event[expando] == true )
    279281                        return event;
    280282
    281283                // store a copy of the original event object
    282284                // and "clone" to set read-only properties
    283                 var originalEvent = event;
     285                var originalEvent = event, props = this.props;
    284286                event = { originalEvent: originalEvent };
    285                 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(" ");
    286287                for ( var i=props.length; i; i-- )
    287288                        event[ props[i] ] = originalEvent[ props[i] ];
    288289