Permalink
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...
1 parent c13b1fc commit a8f0434fa13f785ff2a360feb5b8356ec47ecf47 @victor-homyakov victor-homyakov committed Dec 25, 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;

1 comment on commit a8f0434

@fideloper

This fixed issues for us which cropped up in the latest release of Chrome (v 32.0.17)

Please sign in to comment.