Author: vmolotkov
Date: 2007-12-10 14:46:33 -0500 (Mon, 10 Dec 2007)
New Revision: 4671
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
Log:
bug: RF-1546
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
---
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-10
18:52:28 UTC (rev 4670)
+++
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-10
19:46:33 UTC (rev 4671)
@@ -47,11 +47,6 @@
Richfaces.ListShuttle.prototype = {
initialize: function(targetList, sourceList, clientId, controlIds, switchByClick,
sourceLayoutManager, targetLayoutManager) {
- sourceList._onclickHandler = sourceList.onclickHandler;
- sourceList.onclickHandler = function(e) { this.onclickHandler(e, sourceList);
}.bindAsEventListener(this);
- targetList._onclickHandler = targetList.onclickHandler;
- targetList.onclickHandler = function(e) { this.onclickHandler(e, targetList);
}.bindAsEventListener(this);
-
this.targetList = targetList;
this.sourceList = sourceList;
@@ -64,6 +59,13 @@
if (switchByClick == "true") {
this.targetList.shuttleTable.observe("click", function(e)
{this.moveItemByClick(window.event||e, this.targetList,
this.sourceList)}.bindAsEventListener(this));
this.sourceList.shuttleTable.observe("click", function(e)
{this.moveItemByClick(window.event||e, this.sourceList,
this.targetList)}.bindAsEventListener(this));
+ Event.stopObserving(this.sourceList.shuttleTable, "click",
this.sourceList.clckHandler);
+ Event.stopObserving(this.targetList.shuttleTable, "click",
this.targetList.clckHandler);
+ } else {
+ sourceList._onclickHandler = sourceList.onclickHandler;
+ sourceList.onclickHandler = function(e) { this.onclickHandler(e, sourceList);
}.bindAsEventListener(this);
+ targetList._onclickHandler = targetList.onclickHandler;
+ targetList.onclickHandler = function(e) { this.onclickHandler(e, targetList);
}.bindAsEventListener(this);
}
this.controlList = new Array();
@@ -138,8 +140,8 @@
if (!(item instanceof Richfaces.SelectItem)) {
item = sourceComponent.getSelectItemByNode(item);
}
+ this.removeItem(sourceComponent, item);
this.addItem(targetComponent, item);
- this.removeItem(sourceComponent, item);
},
removeItem : function(component, item) {