diff --git a/custom_subtabs/public/js/custom_subtabs.js b/custom_subtabs/public/js/custom_subtabs.js index 2bff563..84e0a70 100644 --- a/custom_subtabs/public/js/custom_subtabs.js +++ b/custom_subtabs/public/js/custom_subtabs.js @@ -52,7 +52,7 @@ frappe.ui.form.Layout.prototype.setup_tab_events = function () { const parentSubtabs = subtabs[parentTabName] || []; parentSubtabs.forEach((subtabName) => { const subtabElement = $(`.nav-item:contains(${subtabName})`); - const subtabContentId = `${currentDoctype.toLowerCase()}-${subtabName.toLowerCase().replace(/\s+/g, '_')}_tab`; + const subtabContentId = `${currentDoctype.toLowerCase().replace(/\s+/g, '-')}-${subtabName.toLowerCase().replace(/\s+/g, '_')}_tab`; const subtabContent = $(`#${subtabContentId}`); if (subtabElement.length) { @@ -66,7 +66,7 @@ frappe.ui.form.Layout.prototype.setup_tab_events = function () { }); // Show the parent tab's content - const parentTabContentId = `${currentDoctype.toLowerCase()}-${parentTabName.toLowerCase().replace(/\s+/g, '_')}_tab`; + const parentTabContentId = `${currentDoctype.toLowerCase().replace(/\s+/g, '-')}-${parentTabName.toLowerCase().replace(/\s+/g, '_')}_tab`; showTabContent(parentTabContentId); // Recursively handle the parent tab