Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

viewportOffset: extend forElement (it's used twice)

`forElement` was used twice in `viewportOffset`:
1. at line 1147 as `var element = $(forElement);`
2. at line 1156 as `element = forElement;`
This leads to error when `forElement` is string: `Element.viewportOffset('id')`
  • Loading branch information...
commit a8f0434fa13f785ff2a360feb5b8356ec47ecf47 1 parent c13b1fc
@victor-homyakov authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/prototype/dom/layout.js
View
3  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;
Please sign in to comment.
Something went wrong with that request. Please try again.