Merge pull request #245 from dcjones/dev

Correctly check for undefined in getScroll. Fixes #219
master
Dmitry Baranovskiy 2014-05-23 21:01:02 +10:00
commit 28119905a5
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;