amélioration de la lisibilité du code

This commit is contained in:
Christophe-Marie Duquesne
2015-12-06 18:50:04 +01:00
parent 000d35bfb4
commit 0504c8cbff

View File

@@ -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))
); );
} }