Fixed bug when subtabs won't work in doctype with seperate name
This commit is contained in:
parent
a77620953f
commit
b0e7dcd8c0
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue