Author: vmolotkov
Date: 2007-11-23 12:56:09 -0500 (Fri, 23 Nov 2007)
New Revision: 4242
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
autoscroll fixed
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-23
17:54:59 UTC (rev 4241)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-23
17:56:09 UTC (rev 4242)
@@ -41,8 +41,6 @@
this.activeItem = null;
- this.shuttleTop = LayoutManager.getElemXY(this.shuttleTable).top;
-
$(contentTableId).observe("click", function(e)
{this.onclickHandler(window.event || e)}.bindAsEventListener(this));
},
@@ -293,16 +291,19 @@
this.selectedItems.sort(this.compareByRowIndex);
var increment;
var scrollTop = this.shuttleTable.parentNode.scrollTop;
+
+ var shuttleTop = LayoutManager.getElemXY(this.shuttleTable.parentNode).top;
+
if (action == 'up' || action == 'first') {
var targetItemTop = LayoutManager.getElemXY(this.selectedItems[0]).top;
- increment = (targetItemTop - scrollTop) - this.shuttleTop;
+ increment = (targetItemTop - scrollTop) - shuttleTop;
if (increment < 0) {
this.shuttleTable.parentNode.scrollTop += increment;
}
} else if (action == 'down' || action == 'last') {
var item = this.selectedItems[this.selectedItems.length - 1];
- targetItemBottom =
LayoutManager.getElemXY(this.selectedItems[this.selectedItems.length - 1]).top +
item.offsetHeight;
- var increment = (targetItemBottom - scrollTop) - (this.shuttleTop +
this.shuttleTable.parentNode.offsetHeight - LayoutManager.SCROLL_WIDTH);
+ var targetItemBottom =
LayoutManager.getElemXY(this.selectedItems[this.selectedItems.length - 1]).top +
item.offsetHeight;
+ var increment = (targetItemBottom - scrollTop) - (shuttleTop +
this.shuttleTable.parentNode.clientHeight);
if (increment > 0) {
this.shuttleTable.parentNode.scrollTop += increment;
}
Show replies by date