Permalink
Browse files

Merge pull request #87 from victor-homyakov/patch-31

Prevent error in `Element.viewportOffset` when string is passed as first argument.
  • Loading branch information...
2 parents c13b1fc + a8f0434 commit fe2b76fdc2b445345cab2436b9101dfb74171258 @savetheclocktower savetheclocktower committed Dec 26, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/prototype/dom/layout.js
@@ -1144,7 +1144,8 @@
function viewportOffset(forElement) {
var valueT = 0, valueL = 0, docBody = document.body;
- var element = $(forElement);
+ forElement = $(forElement);
+ var element = forElement;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;

0 comments on commit fe2b76f

Please sign in to comment.