From dff2664f0067af57258ba702dde8c5a086499081 Mon Sep 17 00:00:00 2001 From: btangmu Date: Tue, 16 Jul 2024 15:40:36 -0400 Subject: [PATCH] CLDR-16844 Fix bug in last PR: require parameter for cldrInfo.closePanel -Add the boolean parameter for both callers -Log error to console if parameter is undefined --- tools/cldr-apps/js/src/esm/cldrInfo.mjs | 3 +++ tools/cldr-apps/js/src/esm/cldrLoad.mjs | 2 +- tools/cldr-apps/js/src/views/InfoPanel.vue | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cldr-apps/js/src/esm/cldrInfo.mjs b/tools/cldr-apps/js/src/esm/cldrInfo.mjs index c5353e78630..e1ffaf4bfb0 100644 --- a/tools/cldr-apps/js/src/esm/cldrInfo.mjs +++ b/tools/cldr-apps/js/src/esm/cldrInfo.mjs @@ -143,6 +143,9 @@ function openPanel() { * false if closing because switching to a "special" view where the Info Panel doesn't belong */ function closePanel(userWantsHidden) { + if (userWantsHidden === undefined) { + console.error("cldrInfo.closePanel was called with undefined parameter"); + } if (panelVisible) { panelVisible = false; panelWanted = !userWantsHidden; diff --git a/tools/cldr-apps/js/src/esm/cldrLoad.mjs b/tools/cldr-apps/js/src/esm/cldrLoad.mjs index 1cdde412622..db9742a5c4c 100644 --- a/tools/cldr-apps/js/src/esm/cldrLoad.mjs +++ b/tools/cldr-apps/js/src/esm/cldrLoad.mjs @@ -612,7 +612,7 @@ function specialLoad(itemLoadInfo, curSpecial, theDiv) { if (curSpecial !== "general") { cldrGui.hideDashboard(); } - cldrInfo.closePanel(); + cldrInfo.closePanel(false /* userWantsHidden */); // Most special.load() functions do not use a parameter; an exception is // cldrGenericVue.load() which expects the special name as a parameter if (CLDR_LOAD_DEBUG) { diff --git a/tools/cldr-apps/js/src/views/InfoPanel.vue b/tools/cldr-apps/js/src/views/InfoPanel.vue index cdfa281a9f4..47ccff7381f 100644 --- a/tools/cldr-apps/js/src/views/InfoPanel.vue +++ b/tools/cldr-apps/js/src/views/InfoPanel.vue @@ -54,7 +54,7 @@ export default { }, methods: { closeInfoPanel() { - cldrInfo.closePanel(); + cldrInfo.closePanel(true /* userWantsHidden */); }, reloadInfoPanel() {