Author: vmolotkov
Date: 2008-04-22 10:47:54 -0400 (Tue, 22 Apr 2008)
New Revision: 8063
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
Log:
http://jira.jboss.com/jira/browse/RF-1616
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
---
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-04-22
14:47:47 UTC (rev 8062)
+++
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-04-22
14:47:54 UTC (rev 8063)
@@ -112,7 +112,7 @@
}
.rich-ordering-list-items {
- width: 100%;
+ /*width: 100%;*/
}
.rich-ordering-list-active {
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
===================================================================
---
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2008-04-22
14:47:47 UTC (rev 8062)
+++
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2008-04-22
14:47:54 UTC (rev 8063)
@@ -37,6 +37,22 @@
this.headerTable.style.width = "100%";
}
}
+
+ if (Prototype.Browser.IE) {
+ //IE displays unnecessary horizontal scroll
+ //when vertical scroll's displayed
+ if (this.contentDiv && this.contentTable && this.getScrollWidth()) {
+ //alert(this.contentTable.offsetWidth +" "+ this.contentDiv.offsetWidth);
+ if (this.contentTable.offsetWidth && ((this.contentTable.offsetWidth <=
this.contentDiv.clientWidth))) {
+ this.contentTable.style.width = this.contentDiv.clientWidth + "px";
+ this.headerTable.style.width = this.contentDiv.offsetWidth + "px";
+ this.contentDiv.style.overflowX = 'hidden';
+ }
+ } else {
+ this.contentTable.style.width = "100%";
+ this.headerTable.style.width = "100%";
+ }
+ }
}
LayoutManager.prototype.getScrollWidth = function() {
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
---
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-04-22
14:47:47 UTC (rev 8062)
+++
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-04-22
14:47:54 UTC (rev 8063)
@@ -181,9 +181,6 @@
this.setFocus();
-
- //this.saveState();
- //this.layoutManager.widthSynchronization();
}
},
@@ -205,7 +202,6 @@
this.selectAll();
}
this.activeItem.item.doActive(this.getExtRowClass(this.activeItem.rowIndex),
this.columnsClasses);
- //this.saveState();
Event.stop(event);
break;
}
@@ -222,8 +218,6 @@
this.autoScrolling(action, event);
- //this.saveState();
- //this.layoutManager.widthSynchronization();
},
changeActiveItems : function(newItem, item) {
@@ -247,41 +241,23 @@
* Click handler
*/
selectionItem : function(activeItem) {
- //var markedItem = this.getSelectItemByNode(activeItem);
var markedShuttleItem = activeItem;
- //if (markedItem != null) {
- this.resetMarked();
- /*if (markedItem._selected) {
- markedItem._selected = false;
- } else {
- markedItem._selected = true;
- this.selectedItems[0] = markedShuttleItem;
- }*/
- if (activeItem.item.isSelected()) {
- activeItem.item.doNormal(this.getExtRowClass(activeItem.rowIndex),
this.columnsClasses);
- } else {
- activeItem.item.doSelect(this.getExtRowClass(activeItem.rowIndex),
this.columnsClasses);
- this.selectedItems[0] = markedShuttleItem; //TODO: delete
- }
- //}
+ this.resetMarked();
+ if (activeItem.item.isSelected()) {
+ activeItem.item.doNormal(this.getExtRowClass(activeItem.rowIndex),
this.columnsClasses);
+ } else {
+ activeItem.item.doSelect(this.getExtRowClass(activeItem.rowIndex),
this.columnsClasses);
+ this.selectedItems[0] = markedShuttleItem; //TODO: delete
+ }
},
/**
* CTRL+Click handler
*/
addSelectedItem : function(activeItem) {
- //var markedItem = this.getSelectItemByNode(activeItem);
var markedShuttleItem = activeItem;
- /*if (markedItem._selected) {
- this.selectedItems.remove(markedShuttleItem);
- markedItem._selected = false;
- } else {
- markedItem._selected = true;
- this.selectedItems.push(markedShuttleItem);
- }*/
-
if (activeItem.item.isSelected()) {
this.selectedItems.remove(markedShuttleItem); //TODO :delete
activeItem.item.doNormal(this.getExtRowClass(activeItem.rowIndex),
this.columnsClasses);
@@ -298,11 +274,6 @@
this.activeItem.item.doNormal(this.getExtRowClass(this.activeItem.rowIndex),
this.columnsClasses);
}
}
-
- /*if (this.activeItem && !this.getSelectItemByNode(this.activeItem)._selected)
{
- Richfaces.SelectItems.doNormal(this.activeItem);
- }*/
- //this.saveState();
},
/**
@@ -333,7 +304,6 @@
rows[i].item.doSelect(this.getExtRowClass(rows[i].rowIndex), this.columnsClasses);
this.selectedItems.push(rows[i]);
}
- //this.saveState();
},
resetMarked : function() {
@@ -385,15 +355,11 @@
setFocus : function() {
this.focusKeeper.focus();
this.focusKeeper.focused = true;
- //if (this.isListActive()) {
- // this.shuttleTable.className = Richfaces.ListBase.ORDERING_LIST_CLASSES.active;
- //}
},
focusListener : function(e) {
e = e || window.event;
this.focusKeeper.focused = false;
- //this.shuttleTable.className = Richfaces.ListBase.ORDERING_LIST_CLASSES.normal;
if (this.activeItem) {
if (this.activeItem.item.isSelected()) {
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-04-22
14:47:47 UTC (rev 8062)
+++
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-04-22
14:47:54 UTC (rev 8063)
@@ -30,7 +30,7 @@
this.initControlList(containerId, ids);
for (var e in this.events) {
- if (e) {
+ if (e && this.events[e]) {
this.container.observe("rich:" + e.toString(), this.events[e]);
}
}