diff --git a/historique.html b/historique.html index dd42f25..7002f2f 100644 --- a/historique.html +++ b/historique.html @@ -148,9 +148,9 @@ {{$col2}} {{$op_label}} {{$amount}} - {{$stock}} - {{$exterieur}} - {{$dispo}} + {{$stock}} + {{$exterieur}} + {{$dispo}} {{$comment}} {{if $current != "archives"}} @@ -199,7 +199,7 @@ {{$col2}} {{$op_label}} {{$amount}} - {{$stock}} + {{$stock}} {{$comment}} {{:linkbutton @@ -224,3 +224,10 @@ {{/if}} {{:admin_footer}} + + + diff --git a/inventaire.html b/inventaire.html index 249df13..3a02514 100644 --- a/inventaire.html +++ b/inventaire.html @@ -124,7 +124,7 @@ {{$cat_name}} {{$col3}} {{$col4}} - {{$dispo}} + {{$dispo}} {{if $col4 > 0}} {{:linkbutton @@ -159,3 +159,10 @@ {{else}}

Aucun matériel.

{{/list}} + + + diff --git a/scripts.js b/scripts.js new file mode 100644 index 0000000..487abe3 --- /dev/null +++ b/scripts.js @@ -0,0 +1,23 @@ +/** + * désactiver le tri des colonnes ayant la classe nosort dans une liste triable + * @param {Node} liste - liste triable + */ +function disableColumSort(liste) { + + // chercher la première ligne du corps de la table + let columns = liste.querySelectorAll("tbody > tr > td"); + + // chercher la ligne de titres + let titles = liste.querySelectorAll("thead > tr > td"); + + // désactiver le tri + for (let i = 0; i < titles.length; ++i) { + let anchor = titles[i].querySelector("a"); + const classAttr = columns[i].getAttribute("class"); + if (anchor != null && classAttr != null && classAttr.includes("nosort")) { + anchor.removeAttribute("href"); + anchor.removeAttribute("title"); + anchor.removeChild(anchor.firstElementChild); + } + } +}