[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 211/323: sorttable.js : Add an icon if the co
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 211/323: sorttable.js : Add an icon if the column is already sorted |
Date: |
Wed, 14 Mar 2018 17:38:51 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit d557633220792bbf79c24be9fa6c3973127042f3
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 8a65474..0a937d6 100644
--- a/html/js/sorttable.js
+++ b/html/js/sorttable.js
@@ -100,7 +100,7 @@ var 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 @@ var 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] 198/323: Improve Cosmetic : login page, (continued)
- [Noalyss-commit] [noalyss] 198/323: Improve Cosmetic : login page, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 204/323: change email, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 191/323: Fix SQL, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 186/323: Merge branch 'master' into sql-review-700, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 223/323: Dashboard : Event hour is not mandatory, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 224/323: Dashboard : Add event improve cosmetic, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 205/323: CSS : recover box, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 210/323: sorttable.js : alternate properly the color of the table rows, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 220/323: Welcome : adapt to small screen, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 195/323: demo is inactive by default, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 211/323: sorttable.js : Add an icon if the column is already sorted,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 196/323: Fix SQL, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 227/323: patch sql : remove commented code, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 225/323: Dashboard : Fix box, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 181/323: Task #0001535: TVA : réécriture du module CFGTVA, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 183/323: Task #0001536: Achat - Vente : n'utilisez que les codes TVA disponibles, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 215/323: Plugin : fix doc, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 213/323: Plugin : fix indent, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 234/323: Fix warning, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 230/323: index.css : CSS responsive, Dany De Bontridder, 2018/03/14
- [Noalyss-commit] [noalyss] 249/323: SQL Patch : correct syntax for new version, Dany De Bontridder, 2018/03/14