Author: vmolotkov
Date: 2008-01-15 13:17:52 -0500 (Tue, 15 Jan 2008)
New Revision: 5394
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/OrderingList.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
Log:
components were 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 2008-01-15
17:42:12 UTC (rev 5393)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-01-15
18:17:52 UTC (rev 5394)
@@ -1,12 +1,14 @@
if(!window.Richfaces) window.Richfaces = {};
-Richfaces.disableSelectionText = function(e) {
- e = window.event||e;
- if (e.srcElement) {
- if (e.srcElement.tagName) {
- var tagName = e.srcElement.tagName.toUpperCase();
-
- if (tagName != "INPUT" && tagName != "TEXTAREA" /* any
items more? */) {
- return false;
+Richfaces.disableSelectionText = function(target) {
+ target.onselectstart = function(e) {
+ e = window.event||e;
+ if (e.srcElement) {
+ if (e.srcElement.tagName) {
+ var tagName = e.srcElement.tagName.toUpperCase();
+
+ if (tagName != "INPUT" && tagName != "TEXTAREA" /* any
items more? */) {
+ return false;
+ }
}
}
}
@@ -169,7 +171,7 @@
this.setFocus();
- this.saveState();
+ //this.saveState();
//this.layoutManager.widthSynchronization();
}
},
@@ -191,7 +193,7 @@
Event.stop(event);
}
this.activeItem.item.doActive();
- this.saveState();
+ //this.saveState();
break;
}
},
@@ -207,7 +209,7 @@
this.autoScrolling(action, event);
- this.saveState();
+ //this.saveState();
//this.layoutManager.widthSynchronization();
},
@@ -286,7 +288,7 @@
/*if (this.activeItem && !this.getSelectItemByNode(this.activeItem)._selected)
{
Richfaces.SelectItems.doNormal(this.activeItem);
}*/
- this.saveState();
+ //this.saveState();
},
/**
@@ -315,20 +317,17 @@
var rows = this.shuttleTbody.rows;
for (var i = startIndex; i <= endIndex; i++) {
rows[i].item.doSelect();
- //if (this.selectedItems.indexOf(rows[i]) == -1) {
- this.selectedItems.push(rows[i]);
- //}
+ this.selectedItems.push(rows[i]);
}
-
- this.saveState();
+ //this.saveState();
},
resetMarked : function() {
- var rows = this.shuttleTbody.rows;
- for (var i = 0; i < rows.length; i++) {
+ var rows = this.selectedItems;
+ var length = rows.length;
+ for (var i = 0; i < length; i++) {
var shuttleItem = rows[i];
shuttleItem.item.doNormal();
- //this.getSelectItemByNode(shuttleItem)._selected = false; //FIXME
}
this.selectedItems.length = 0;
@@ -408,15 +407,15 @@
return true;
}
return false;
- },
+ }//,
- saveState : function() {
+ /*saveState : function() {
for (var i = 0; i < this.shuttleItems.length; i++) {
var item = this.shuttleItems[i];
item.saveState();
}
- }
+ }*/
}
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-01-15
17:42:12 UTC (rev 5393)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-01-15
18:17:52 UTC (rev 5394)
@@ -88,7 +88,7 @@
moveActiveItem : function($super, action, event) {
$super(action, event);
- this.saveState();
+ //this.saveState();
this.controlListManager();
},
@@ -137,7 +137,7 @@
this.container.fire("rich:onorderchanged", {});
this.controlListManager();
- this.saveState();
+ //this.saveState();
}
},
@@ -168,7 +168,7 @@
Event.stop(event);
}
this.activeItem.item.doActive();
- this.saveState();
+ //this.saveState();
this.controlListManager();
break;
}
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2008-01-15
17:42:12 UTC (rev 5393)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2008-01-15
18:17:52 UTC (rev 5394)
@@ -28,6 +28,8 @@
this.addClass(row, classes.ROW.ACTIVE, classes.CELL.ACTIVE);
this.active = true;
+
+ this.saveState();
},
doSelect : function() {
@@ -35,20 +37,30 @@
var classes = this.CLASSES;
this.addClass(row, classes.ROW.SELECTED, classes.CELL.SELECTED);
- this.removeClass(row, classes.ROW.ACTIVE, classes.CELL.ACTIVE);
+ if (this.active) {
+ this.removeClass(row, classes.ROW.ACTIVE, classes.CELL.ACTIVE);
+ }
this.selected = true;
+
+ this.saveState();
},
doNormal : function() {
var row = this._node;
var classes = this.CLASSES;
- this.removeClass(row, classes.ROW.SELECTED, classes.CELL.SELECTED);
- this.removeClass(row, classes.ROW.ACTIVE, classes.CELL.ACTIVE);
+ if (this.active) {
+ this.removeClass(row, classes.ROW.ACTIVE, classes.CELL.ACTIVE);
+ }
+ if (this.selected) {
+ this.removeClass(row, classes.ROW.SELECTED, classes.CELL.SELECTED);
+ }
this.active = false;
this.selected = false;
+
+ this.saveState();
},
isSelected : function() {
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-01-15
17:42:12 UTC (rev 5393)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-01-15
18:17:52 UTC (rev 5394)
@@ -48,11 +48,10 @@
Array.prototype.remove = function(object) {
var index = this.indexOf(object, 0, this.length);
+ if (index == -1) return;
if (index == 0) {
this.shift();
} else {
this.splice(index, 1);
}
}
-
-