Fix for node server side react rendering. window undefined

When compiling react components server side, window reference throws error in node:

```
/app/components/react-draggable.js:62
var isTouchDevice = 'ontouchstart' in window // works on most browsers
                                      ^
ReferenceError: window is not defined
```

I added a conditional wrapper to fix this issue.
Good call.

I updated the conditional to check for the window object

- David

On Fri, Dec 26, 2014 at 11:47 AM, Matt Zabriskie <notifications@github.com>
wrote:

> In lib/draggable.js
> <https://github.com/mzabriskie/react-draggable/pull/30#discussion-diff-22287488>
> :
>
> > @@ -49,8 +49,16 @@ function matchesSelector(el, selector) {
> >  }
> >
> >  // @credits: http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript/4819886#4819886
> > -var isTouchDevice = 'ontouchstart' in window // works on most browsers
> > +/* Conditional to fix node server side rendering of component */
> > +if (typeof module !== "undefined" && typeof require !== "undefined") {
>
> I worry that this conditional isn't conclusive enough. If browser is using
> AMD require will be defined. Also not unreasonable that someone may
> define module in the browser.
>
> I would vote for one of the following:
>
> if (typeof window === 'undefined') {
>
> or
>
> if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mzabriskie/react-draggable/pull/30/files#r22287488>.
>