From 17c2b47dadba306747ae1a4a8bcafe352de902c8 Mon Sep 17 00:00:00 2001 From: Christophe-Marie Duquesne Date: Mon, 7 Dec 2015 09:48:21 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9paration=20des=20probl=C3=A8mes=20de=20t?= =?UTF-8?q?ri=20pour=20chrome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- creuille.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/creuille.js b/creuille.js index 09272c1..c03d462 100644 --- a/creuille.js +++ b/creuille.js @@ -50,8 +50,15 @@ function construitListe(traductions) { traductions = traductions["vrais mots"].concat(traductions["faux mots"]); // tri par ordre alphabétique de la langue de départ traductions.sort(function(traduction1, traduction2){ - return (sansAccents(traduction1[langue]) > - sansAccents(traduction2[langue])); + var s1 = sansAccents(traduction1[langue]); + var s2 = sansAccents(traduction2[langue]); + if (s1 > s2) { + return 1; + } + if (s2 > s1) { + return -1; + } + return 0; }); $( "#mots" ).html("");