Skip to content

Commit

Permalink
viewportOffset: extend forElement (it's used twice)
Browse files Browse the repository at this point in the history
`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
Victor Homyakov committed Dec 25, 2012
1 parent c13b1fc commit a8f0434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prototype/dom/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a8f0434

Please sign in to comment.