Author: pyaschenko
Date: 2010-07-06 13:03:37 -0400 (Tue, 06 Jul 2010)
New Revision: 17747
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/jquery.position.js
Log:
position bug fixing
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/jquery.position.js
===================================================================
---
root/core/trunk/impl/src/main/resources/META-INF/resources/jquery.position.js 2010-07-06
17:03:33 UTC (rev 17746)
+++
root/core/trunk/impl/src/main/resources/META-INF/resources/jquery.position.js 2010-07-06
17:03:37 UTC (rev 17747)
@@ -67,10 +67,10 @@
var stype = typeof source;
if (stype == "object" || stype == "string") {
var rect = {};
- if (source.type) {
+ if (stype == "string" || source.nodeType || source instanceof jQuery) {
+ rect = getElementRect(source);
+ } else if (source.type) {
rect = getPointerRect(source);
- } else if (stype == "string" || source.nodeType || source instanceof jQuery)
{
- rect = getElementRect(source);
} else if (source.id) {
rect = getElementRect(document.getElementById(source.id));
} else {
@@ -175,20 +175,20 @@
function getPositionRect(baseRect, rectOffset, elementDim, pos) {
var rect = {};
// TODO: add support for center and middle // may be middle rename to center too
- // TODO: add rectOffset support
+ // TODO: add rectOffset support && tests
var v = pos.charAt(0);
if (v=='L') {
- rect.left = baseRect.left// + rectOffset.left;
+ rect.left = baseRect.left;
} else if (v=='R') {
- rect.left = baseRect.left + baseRect.width;// - rectOffset.left;
+ rect.left = baseRect.left + baseRect.width;
}
v = pos.charAt(1);
if (v=='T') {
- rect.top = baseRect.top// + rectOffset.left;
+ rect.top = baseRect.top;
} else if (v=='B') {
- rect.top = baseRect.top + baseRect.height;// - rectOffset.left;
+ rect.top = baseRect.top + baseRect.height;
}
v = pos.charAt(2);