Skip to content

Commit 126242a

Browse files
committed
update conditional to check for window
1 parent cd0ba24 commit 126242a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/draggable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ function matchesSelector(el, selector) {
5050

5151
// @credits: http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript/4819886#4819886
5252
/* Conditional to fix node server side rendering of component */
53-
if (typeof module !== "undefined" && typeof require !== "undefined") {
53+
if (typeof window === 'undefined') {
5454
// Do Node Stuff
5555
var isTouchDevice = false;
56-
5756
} else {
5857
// Do Browser Stuff
5958
var isTouchDevice = 'ontouchstart' in window // works on most browsers
6059
|| 'onmsgesturechange' in window; // works on ie10 on ms surface
60+
6161
}
6262

6363
// look ::handleDragStart

0 commit comments

Comments
 (0)