Skip to content

Commit

Permalink
allow server render
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Nov 6, 2015
1 parent 41098dc commit cc9a97c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "add-dom-event-listener",
"version": "1.0.0",
"version": "1.0.1",
"description": "add dom event listener. normalize ie and others",
"keywords": [
"dom",
Expand Down
5 changes: 2 additions & 3 deletions src/EventObject.js
Expand Up @@ -6,7 +6,6 @@

import EventBaseObject from './EventBaseObject';
import assign from 'object-assign';
const DOCUMENT = document;
const TRUE = true;
const FALSE = false;
const commonProps = [
Expand Down Expand Up @@ -140,7 +139,7 @@ const eventNormalizers = [

// Calculate pageX/Y if missing and clientX/Y available
if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) {
eventDoc = target.ownerDocument || DOCUMENT;
eventDoc = target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = nativeEvent.clientX +
Expand Down Expand Up @@ -231,7 +230,7 @@ function DomEventObject(nativeEvent) {

// fix target property, if necessary
if (!this.target && isNative) {
this.target = nativeEvent.srcElement || DOCUMENT; // srcElement might not be defined either
this.target = nativeEvent.srcElement || document; // srcElement might not be defined either
}

// check if target is a text node (safari)
Expand Down

0 comments on commit cc9a97c

Please sign in to comment.