[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 08/11: new function alternate_row_color_list
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 08/11: new function alternate_row_color_list |
Date: |
Thu, 8 Aug 2024 14:52:17 -0400 (EDT) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit f46f136256470232360438ad59f2d54aeb5de098
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Aug 7 17:11:25 2024 +0200
new function alternate_row_color_list
---
html/js/noalyss_script.js | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index 9e3f6a978..b9d673921 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -2201,7 +2201,7 @@ function filter_table(phrase, _id, colnr, start_row) {
}
/**
- * filter quickly a list
+ * filter quickly a list, the content to check must be inside a SPAN with the
CLASS "search-content"
* @param phrase : DOM id of the input text where we find the word to seach,
the searchable content use the className searchContent
* @param _id : id of the list
* @returns nothing
@@ -3158,6 +3158,30 @@ function alternate_row_color(p_table) {
}
}
+/**
+ * Colorize the rows of the list
+ * @param string p_table id of the table
+ */
+function alternate_row_color_list(p_list) {
+ var list_colored = $(p_list);
+ if ( list_colored.children.length==0 ) return;
+
+ var len = list_colored.children.length;
+ var i = 0;
+ var localClass = "";
+ for (i = 1; i < len; i++) {
+ localClass = (i % 2 == 0) ? "even" : "odd";
+ if (list_colored.children[i].hasClassName("odd")) {
+ list_colored.children[i].removeClassName("odd");
+ }
+ if (list_colored.children[i].hasClassName("even")) {
+ list_colored.children[i].removeClassName("even");
+ }
+ list_colored.children[i].addClassName(localClass);
+ }
+
+}
+
/**
* Make an DOM element draggable or not
- [Noalyss-commit] [noalyss] branch unstable updated (65dd4e31c -> 451b9cb7c), dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 03/11: GESTION : operation add receipt number, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 11/11: documentation, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 01/11: Documentation, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 07/11: CCARD : rewrite, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 04/11: CCARD : rewriting interface, code cleanup, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 08/11: new function alternate_row_color_list,
dwm <=
- [Noalyss-commit] [noalyss] 09/11: CCARD : remove category card with confirm, remove dead code, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 05/11: Javascript : documentation avec JSDOC, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 06/11: Cosmetic h1.legend, legend & fieldset, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 10/11: Fix : retrieve label from tva_code, dwm, 2024/08/08
- [Noalyss-commit] [noalyss] 02/11: Bug : fix create event from AGENDA, dwm, 2024/08/08