Author: dmorozov
Date: 2007-07-09 03:55:36 -0400 (Mon, 09 Jul 2007)
New Revision: 1538
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
Log:
Simplify header sort icons
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-07-08
13:49:02 UTC (rev 1537)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-07-09
07:55:36 UTC (rev 1538)
@@ -169,14 +169,8 @@
sep.setStyle({cursor: 'auto'});
}
// sort icons
- columns[j].sortDesc = details[1];
- columns[j].sortAsc = details[2];
- columns[j].sortSpace = details[3];
- if(ClientUILib.isIE && columns[j].sortDesc) {
- Element.setStyle(columns[j].sortDesc, {left: "-10px"});
- Element.setStyle(columns[j].sortAsc, {left: "-10px"});
- Element.setStyle(columns[j].sortSpace, {left: "-10px"});
- }
+ columns[j].sortDesc = new ClientUI.common.box.Box(details[1], null, true);
+ columns[j].sortAsc = new ClientUI.common.box.Box(details[2], null, true);
j++;
}
@@ -222,14 +216,8 @@
sep.setStyle({cursor: 'auto'});
}
// sort icons
- columns[j].sortDesc = details[1];
- columns[j].sortAsc = details[2];
- columns[j].sortSpace = details[3];
- if(ClientUILib.isIE && columns[j].sortDesc) {
- Element.setStyle(columns[j].sortDesc, {left: "-10px"});
- Element.setStyle(columns[j].sortAsc, {left: "-10px"});
- Element.setStyle(columns[j].sortSpace, {left: "-10px"});
- }
+ columns[j].sortDesc = new ClientUI.common.box.Box(details[1], null, true);
+ columns[j].sortAsc = new ClientUI.common.box.Box(details[2], null, true);
}
j++;
}
@@ -256,7 +244,6 @@
details[0] = document.getElementById(clientId + ":hsep_" + column);
details[1] = document.getElementById(clientId + ":hsortd_" + column);
details[2] = document.getElementById(clientId + ":hsorta_" + column);
- details[3] = document.getElementById(clientId + ":hsort_" + column);
return details;
},
agjustSeparators: function() {
@@ -420,13 +407,13 @@
var h = this.getColumns()[i];
if(h.sortDesc && h.sortAsc) {
if(i != index) {
- Element.setStyle(h.sortDesc, {display: 'none'});
- Element.setStyle(h.sortAsc, {display: 'none'});
- Element.setStyle(h.sortSpace, {display: 'block'});
+ Element.setStyle(h.sortDesc.getElement(), {display: 'none'});
+ Element.setStyle(h.sortAsc.getElement(), {display: 'none'});
} else{
- Element.setStyle(h.sortDesc, {display: (dir == 'desc' ? 'block' :
'none')});
- Element.setStyle(h.sortAsc, {display: (dir == 'asc' ? 'block' :
'none')});
- Element.setStyle(h.sortSpace, {display: 'none'});
+ h.sortDesc.moveTo(h.object.getWidth() - 16, 4);
+ h.sortAsc.moveTo(h.object.getWidth() - 16, 4);
+ Element.setStyle(h.sortDesc.getElement(), {display: (dir == 'desc' ?
'block' : 'none')});
+ Element.setStyle(h.sortAsc.getElement(), {display: (dir == 'asc' ?
'block' : 'none')});
}
}
}
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-08
13:49:02 UTC (rev 1537)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-09
07:55:36 UTC (rev 1538)
@@ -86,28 +86,22 @@
border-right: 1px solid #ebeadb;
}
-.ClientUI_Grid_HC sort-cell {
- background-position: right;
- background-repeat: no-repeat;
- display: block;
- width: 16px !important;;
- position: relative;
-}
-
.ClientUI_Grid_HC .sort-asc {
+/* background-image: url(sort_asc.gif);*/
background-position: right;
background-repeat: no-repeat;
display: none;
width: 16px !important;;
- position: relative;
+ position: absolute;
}
.ClientUI_Grid_HC .sort-desc {
+/* background-image: url(sort_desc.gif);*/
background-position: right;
background-repeat: no-repeat;
display: none;
width: 16px !important;;
- position: relative;
+ position: absolute;
}
/**
@@ -148,14 +142,6 @@
width: 100%;
font: normal 8pt arial;
}
-.ClientUI_Grid_HCBody span {
- font: normal 8pt arial;
- white-space: nowrap;
-}
-.ClientUI_Grid_HCBodyContent {
- font: normal 8pt arial;
- white-space: nowrap;
-}
.ClientUI_Grid_HC_Over{
border-bottom: 1px solid #fcc247;
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-07-08
13:49:02 UTC (rev 1537)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-07-09
07:55:36 UTC (rev 1538)
@@ -13,25 +13,12 @@
<td class="ClientUI_Grid_HC Idg-header-cell
#{component.attributes['headerClass']}"
id="#{client_id}:hc_#{cell_index}" columnIndex="#{cell_index}"
sortable="#{component.attributes['sortable']}">
- <span id="#{clientId}:hcb_#{cell_index}"
+ <div id="#{clientId}:hcb_#{cell_index}"
class="ClientUI_Grid_HCBody">
- <table width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
- <tbody>
- <tr>
- <td width="100%">
- <span style="width: 100%;">
- <vcp:body/>
- </span>
- </td>
- <td>
- <div id="#{client_id}:hsort_#{cell_index}"
class="sort-cell"> </div>
- <span id="#{client_id}:hsortd_#{cell_index}"
class="sort-desc" />
- <span id="#{client_id}:hsorta_#{cell_index}"
class="sort-asc" />
- </td>
- </tr>
- </tbody>
- </table>
- </span>
+ <vcp:body/>
+ <div align="right"
id="#{client_id}:hsortd_#{cell_index}" class="sort-desc" />
+ <div align="right"
id="#{client_id}:hsorta_#{cell_index}" class="sort-asc" />
+ </div>
<jsp:scriptlet>
int offset = ((Integer)variables.getVariable("sepOffset")).intValue() - 3;