[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 17/18: sorttable.js : Add an icon if the colu
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 17/18: sorttable.js : Add an icon if the column is already sorted |
Date: |
Sun, 22 Apr 2018 09:30:31 -0400 (EDT) |
sparkyx pushed a commit to annotated tag rel6919-syn-180310
in repository noalyss.
commit 7fd6ea59a1528836d3d7e9616a01ae5046ffeddb
Author: Dany De Bontridder <address@hidden>
Date: Fri Feb 16 08:02:28 2018 +0100
sorttable.js : Add an icon if the column is already sorted
---
html/js/sorttable.js | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/html/js/sorttable.js b/html/js/sorttable.js
index 85a1be9..3b64695 100644
--- a/html/js/sorttable.js
+++ b/html/js/sorttable.js
@@ -100,7 +100,7 @@ sorttable = {
}
// work through each column and calculate its type
- headrow = table.tHead.rows[0].cells;
+ var headrow = table.tHead.rows[0].cells;
for (var i = 0; i < headrow.length; i++) {
// manually override the type with a sorttable_type attribute
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip
this col
@@ -113,6 +113,20 @@ sorttable = {
} else {
headrow[i].sorttable_sortfunction =
sorttable.guessType(table, i);
}
+ //--------- if already sorted , add a icon ----------------
+ if
(headrow[i].className.search(/\bsorttable_sorted_reverse\b/) != -1) {
+ // if we're already sorted by this column,
+ sortrevind = document.createElement('span');
+ sortrevind.id = "sorttable_sortrevind";
+ sortrevind.innerHTML = '<img src="image/down.gif">';
+ headrow[i].appendChild(sortrevind);
+ }
+ if (headrow[i].className.search(/\bsorttable_sorted\b/) != -1)
{
+ sortfwdind = document.createElement('span');
+ sortfwdind.id = "sorttable_sortfwdind";
+ sortfwdind.innerHTML = '<img src="image/up.gif">';
+ headrow[i].appendChild(sortfwdind);
+ }
// make it clickable to sort
headrow[i].sorttable_columnindex = i;
headrow[i].sorttable_tbody = table.tBodies[0];
- [Noalyss-commit] [noalyss] 02/18: Fix problem with invalid unicode sequence, (continued)
- [Noalyss-commit] [noalyss] 02/18: Fix problem with invalid unicode sequence, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 07/18: Accounting : error message if accounting is too large, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 06/18: Accounting : error message if accounting is too large, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 01/18: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 08/18: set version 6919.7, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 03/18: Protect queryString with encodeURI, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 09/18: Task #0001507: Click sur détail opérations apparaît trop haut Use the function window.pageYOffset instead of window.scrollY, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 16/18: sorttable.js : alternate properly the color of the table rows, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 11/18: Calc : set 4 decimals, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 13/18: Merge from rel6919.7 Merge branch 'dev-6919.2' of ns3:/srv/git/noalyss into dev-6919.2, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 17/18: sorttable.js : Add an icon if the column is already sorted,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 05/18: Set version 6919.6, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 12/18: Upgrade the branch with the stable release 6919.7 Merge tag 'rel6919.7' into dev-6919.2, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 15/18: Merge tag 'rel6919.8' into dev-6919.2, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 10/18: Improve calc, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 14/18: Merge tag 'rel6919.8' into dev-6919.2, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 18/18: Manage_Table : add sort, Dany De Bontridder, 2018/04/22