Author: vmolotkov
Date: 2007-11-13 05:53:18 -0500 (Tue, 13 Nov 2007)
New Revision: 3941
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
Log:
scroll handler was corrected
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js 2007-11-12
23:07:54 UTC (rev 3940)
+++
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js 2007-11-13
10:53:18 UTC (rev 3941)
@@ -9,10 +9,10 @@
}
Control.CLASSES = {
- first : {hidden : "ol_control_hidden", shown : "ol_control_shown",
disabled : "", enabled : ""},
- down : {hidden : "ol_control_hidden", shown : "ol_control_shown",
disabled : "", enabled : ""},
- up : {hidden : "ol_control_hidden", shown : "ol_control_shown",
disabled : "", enabled : ""},
- last : {hidden : "ol_control_hidden", shown : "ol_control_shown",
disabled : "", enabled : ""}
+ first : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"},
+ down : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"},
+ up : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"},
+ last : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"}
};
Control.prototype.doShow = function() {
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-12
23:07:54 UTC (rev 3940)
+++
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-13
10:53:18 UTC (rev 3941)
@@ -476,16 +476,21 @@
Shuttle.prototype.autoScrolling = function(action, event) {
this.selectedItems.sort(this.compareByRowIndex);
- var targetItemTop;
+ var increment;
+ var scrollTop = this.shuttleTable.parentNode.scrollTop;
if (action == 'up' || action == 'first') {
- targetItemTop = LayoutManager.getElemXY(this.selectedItems[0]).top;
- var increment = targetItemTop - this.shuttleTop;
- this.shuttleTable.parentNode.scrollTop = increment;
+ var targetItemTop = LayoutManager.getElemXY(this.selectedItems[0]).top;
+ increment = (targetItemTop - scrollTop) - this.shuttleTop;
+ if (increment < 0) {
+ this.shuttleTable.parentNode.scrollTop += increment;
+ }
} else if (action == 'down' || action == 'last') {
var item = this.selectedItems[this.selectedItems.length - 1];
- targetItemTop = LayoutManager.getElemXY(this.selectedItems[this.selectedItems.length -
1]).top + item.offsetHeight;
- var increment = targetItemTop - (this.shuttleTop +
this.shuttleTable.parentNode.offsetHeight - LayoutManager.SCROLL_WIDTH);
- this.shuttleTable.parentNode.scrollTop = increment;
+ 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);
+ if (increment > 0) {
+ this.shuttleTable.parentNode.scrollTop += increment;
+ }
}
Shuttle.stopPropogation(event);
}
Show replies by date