From 6737757999a88309455a75b1c5e60b89407b3c14 Mon Sep 17 00:00:00 2001 From: Kenneth Bruskiewicz Date: Tue, 10 Dec 2024 12:24:40 -0800 Subject: [PATCH] pushed load json data into conditional which does nothing if the container format isn't adhered to --- lib/Toolbar.js | 52 +++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/Toolbar.js b/lib/Toolbar.js index 66047f66..7dc3f6d9 100644 --- a/lib/Toolbar.js +++ b/lib/Toolbar.js @@ -416,29 +416,29 @@ class Toolbar { alert( 'Error: JSON data file does not have Container dictionary.' ); - } - - // NOTE: the data is possibly *sparse*. where does it make sense to fill in its missing alues? - // It doesn't appear to matter - - for (const dh in context.dhs) { - const container_class = rangeToContainerClass( - context.template.default.schema.classes.Container, - dh - ); - const list_data = context.dhs[dh].loadDataObjects( - jsonData.Container[container_class], - locale - ); - if (list_data) context.dhs[dh].hot.loadData(list_data); - else - alert( - 'Unable to fetch table data from json file ' + - template_path + - ' for ' + - dh + } else { + // NOTE: the data is possibly *sparse*. where does it make sense to fill in its missing alues? + // It doesn't appear to matter + for (const dh in context.dhs) { + const container_class = rangeToContainerClass( + context.template.default.schema.classes.Container, + dh ); + const list_data = context.dhs[dh].loadDataObjects( + jsonData.Container[container_class], + locale + ); + if (list_data) context.dhs[dh].hot.loadData(list_data); + else + alert( + 'Unable to fetch table data from json file ' + + template_path + + ' for ' + + dh + ); + } } + return context; }) .then(this.restartInterface.bind(this)); @@ -912,10 +912,6 @@ class Toolbar { } }); - // - // DEPRECATE: no need to refresh the translation select since the languages are taken from a global list - // it's up to the templates to ensure all the languages are supported - // const currentTranslationVal = $('#select-translation-localization').val(); const translationSelect = $('#select-translation-localization').empty(); for (const { nativeName, langcode } of Object.values( @@ -925,9 +921,13 @@ class Toolbar { } if (currentTranslationVal) { translationSelect.val(currentTranslationVal); + // + // DEPRECATE: no need to refresh the translation select since the languages are taken from a global list + // it's up to the templates to ensure all the languages are supported + // // translationSelect.trigger('input'); } else { - // translationSelect.val('en'); + translationSelect.val('en'); } const helpSop = $('#help_sop');