From efb390fe7a8fac9075513879ae7dbe1374c2a2c9 Mon Sep 17 00:00:00 2001 From: yamanq Date: Mon, 16 Apr 2018 00:40:53 -0400 Subject: [PATCH] alphabetize phonemes --- SmearcarDB/static/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SmearcarDB/static/index.js b/SmearcarDB/static/index.js index 2b9217d..eb1c2a6 100644 --- a/SmearcarDB/static/index.js +++ b/SmearcarDB/static/index.js @@ -173,7 +173,17 @@ function generateDropOp() { // For options that change based on data. // Generate data box material. - var phonemes = Object.keys(langInfo.phonemes); + var phonemes = Object.keys(langInfo.phonemes).sort(function(a, b) { + var A = Object.keys(a)[0]; // ignore upper and lowercase + var B = Object.keys(b)[0]; // ignore upper and lowercase + if (A < B) { + return -1; + } else if (A > B) { + return 1; + } else { + return 0; + } + });; while (dataBox.firstChild) { dataBox.removeChild(dataBox.firstChild);