[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 13/39: JS : improve code alternate_row_color
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 13/39: JS : improve code alternate_row_color |
Date: |
Sat, 11 Jul 2020 13:20:38 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 7a30cbe0c762852b5a7697298d1d473a951321b9
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Tue Jun 2 13:54:01 2020 +0200
JS : improve code alternate_row_color
---
html/js/scripts.js | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 2809429..631f6a8 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -3045,28 +3045,21 @@ function alert_box(p_message)
*/
function alternate_row_color(p_table)
{
- var len = $(p_table).tBodies[0].rows.length;
+ var table_colored=$(p_table);
+ var len = table_colored.tBodies[0].rows.length;
var i = 0;
var localClass = "";
for (i = 1; i < len; i++) {
localClass = (i % 2 == 0) ? "even" : "odd";
- if (localClass == "even" &&
$(p_table).tBodies[0].rows[i].hasClassName("odd"))
+ if ( table_colored.tBodies[0].rows[i].hasClassName("odd"))
{
- $(p_table).tBodies[0].rows[i].removeClassName("odd");
+ table_colored.tBodies[0].rows[i].removeClassName("odd");
}
- if (localClass == "even" &&
!$(p_table).tBodies[0].rows[i].hasClassName("even"))
+ if (table_colored.tBodies[0].rows[i].hasClassName("even"))
{
- $(p_table).tBodies[0].rows[i].addClassName("even");
- }
-
- if (localClass == "odd" &&
$(p_table).tBodies[0].rows[i].hasClassName("even"))
- {
- $(p_table).tBodies[0].rows[i].removeClassName("even");
- }
- if (localClass == "odd" &&
!$(p_table).tBodies[0].rows[i].hasClassName("odd"))
- {
- $(p_table).tBodies[0].rows[i].addClassName("odd");
+ table_colored.tBodies[0].rows[i].removeClassName("even");
}
+ table_colored.tBodies[0].rows[i].addClassName(localClass);
}
}
- [Noalyss-commit] [noalyss] 06/39: Compatibility postgresql 12, (continued)
- [Noalyss-commit] [noalyss] 06/39: Compatibility postgresql 12, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 03/39: Fix problem with redirect, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 12/39: CSS : new background-selected for a row in table, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 16/39: task #0001413: Duplication d'opération 2 - le retour, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 18/39: Task #1803 : export detail of an operation in PDF, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 14/39: task #0001801: CARD : mise à jour fiche , effacement et modification, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 15/39: Select Box : improve position in floating element, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 17/39: task #0001801: CARD : mise à jour fiche , effacement et modification, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 25/39: Code : not direct access to $_GET Bug : javascript didn't work, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 26/39: Bug : compatibility PHP7.4, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 13/39: JS : improve code alternate_row_color,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 19/39: Set new version, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 23/39: warning about undefined $this->f_id_dest, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 22/39: Error with card, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 27/39: Cosmetic #1808 : Ma au lieu de Me dans le calendrier, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 24/39: Cosmetic : disconnect, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 21/39: Install show choosen password for admin, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 28/39: update config.inc.example file, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 29/39: Orthographe, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 31/39: Bug : extourne ne fonctionne plus, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 20/39: Install : initialize variabvle, Dany De Bontridder, 2020/07/11