Correctly check for undefined in getScroll. Fixes #219

master
Daniel Jones 2014-05-15 22:47:07 -07:00
parent d1f8db5f6e
commit 78bf554eb2
1 changed files with 5 additions and 1 deletions

View File

@ -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;