From 78bf554eb2306b87abc426aa6e6c5e95975af3b2 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Thu, 15 May 2014 22:47:07 -0700 Subject: [PATCH] Correctly check for undefined in getScroll. Fixes #219 --- src/mouse.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mouse.js b/src/mouse.js index eeadd98..d159ca3 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -27,7 +27,11 @@ Snap.plugin(function (Snap, Element, Paper, glob) { }, getScroll = function (xy) { var name = xy == "y" ? "scrollTop" : "scrollLeft"; - return glob.doc.documentElement[name] || glob.doc.body[name]; + if (name in glob.doc.documentElement) { + return glob.doc.documentElement[name]; + } else { + return glob.doc.body[name]; + } }, preventDefault = function () { this.returnValue = false;