mirror of
https://github.com/soulaklabs/bitoduc.fr.git
synced 2025-12-09 01:23:24 +00:00
amélioration de la lisibilité du code
This commit is contained in:
14
creuille.js
14
creuille.js
@@ -53,23 +53,23 @@ function construitListe(traductions) {
|
|||||||
$( "#mots" ).html("");
|
$( "#mots" ).html("");
|
||||||
$( "#index" ).html("");
|
$( "#index" ).html("");
|
||||||
|
|
||||||
var lettreAlphabet = '';
|
var lettre = '';
|
||||||
for (var i=0; i < traductions.length; i++) {
|
for (var i=0; i < traductions.length; i++) {
|
||||||
var mot = traductions[i];
|
var mot = traductions[i];
|
||||||
var l = sansAccents(mot[langue]).charAt(0).toUpperCase();
|
var l = sansAccents(mot[langue]).charAt(0).toUpperCase();
|
||||||
|
|
||||||
if (l != lettreAlphabet) {
|
if (l != lettre) {
|
||||||
lettreAlphabet = l;
|
lettre = l;
|
||||||
$( "#index" ).append(
|
$( "#index" ).append(
|
||||||
$("<a></a>")
|
$("<a></a>")
|
||||||
.attr("href", "#" + lettreAlphabet)
|
.attr("href", "#" + lettre)
|
||||||
.html(lettreAlphabet)
|
.html(lettre)
|
||||||
);
|
);
|
||||||
$( "#mots" ).append(
|
$( "#mots" ).append(
|
||||||
$("<div></div>")
|
$("<div></div>")
|
||||||
.attr("class", "groupe-lettre")
|
.attr("class", "groupe-lettre")
|
||||||
.append($("<a></a>").attr("name", lettreAlphabet))
|
.append($("<a></a>").attr("name", lettre))
|
||||||
.append($("<h3></h3>").html(lettreAlphabet))
|
.append($("<h3></h3>").html(lettre))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user