[richfaces-svn-commits] JBoss Rich Faces SVN: r4769 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Wed Dec 12 08:05:14 EST 2007
Author: vmolotkov
Date: 2007-12-12 08:05:14 -0500 (Wed, 12 Dec 2007)
New Revision: 4769
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
items selection by shift+click was changed.
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-12-12 12:05:40 UTC (rev 4768)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-12-12 13:05:14 UTC (rev 4769)
@@ -50,6 +50,7 @@
this.shuttleTbody = this.shuttleTable.tBodies[0];
this.activeItem = null;
+ this.pseudoActiveItem = null; //it services for items selection by Shift+click
this.items = null;
this.retrieveShuttleItems(containerId, controlClass);
@@ -60,6 +61,11 @@
this.shuttleTable.observe("click", this.clckHandler);
},
+ setActiveItem : function(newActiveItem) {
+ this.pseudoActiveItem = newActiveItem;
+ this.activeItem = newActiveItem;
+ },
+
retrieveShuttleItems : function(containerId, controlClass) {
var rows = this.shuttleTbody.rows;
this.shuttleItems = new Array();
@@ -73,7 +79,7 @@
this.selectedItems.push(row);
}
if (item.isActive()) {
- this.activeItem = row;
+ this.setActiveItem(row);
}
this.shuttleItems[i] = item;
}
@@ -126,8 +132,7 @@
onfocusHandler: function (event) {
if (!this.activeItem && this.shuttleItems.length != 0) {
- this.activeItem = this.shuttleItems[0]._node;
-
+ this.setActiveItem(this.shuttleItems[0]._node);
}
if (this.activeItem) {
@@ -144,12 +149,13 @@
if (event.ctrlKey) {
this.addSelectedItem(activeElem);
- this.activeItem = activeElem;
+ this.setActiveItem(activeElem);
} else if (event.shiftKey) {
this.selectItemGroup(activeElem);
+ this.activeItem = activeElem; //given event works with pseudoActiveItem
} else {
this.selectionItem(activeElem);
- this.activeItem = activeElem;
+ this.setActiveItem(activeElem);
}
@@ -202,7 +208,7 @@
newItem.item.doSelect();
newItem.item.doActive();
- this.activeItem = newItem;
+ this.setActiveItem(newItem);
this.selectedItems.push(newItem);
},
@@ -279,7 +285,7 @@
*/
selectItemGroup : function(currentItem) {
//FIXME
- var activeItemIndex = this.activeItem.rowIndex;
+ var activeItemIndex = this.pseudoActiveItem.rowIndex;
var startIndex;
var endIndex;
More information about the richfaces-svn-commits
mailing list