Skip to content
Snippets Groups Projects

Resolve #3498100 "Duplicate summary on vertical tabs"

1 unresolved thread
Files
6
@@ -85,8 +85,13 @@
@@ -85,8 +85,13 @@
$details.each(function () {
$details.each(function () {
const $that = $(this);
const $that = $(this);
const $summary = $that.find('> summary');
const $summary = $that.find('> summary');
 
// Summary elements often have 2 child nodes: a text title and a
 
// dynamic summary wrapped in <span>. To set the vertical tab title,
 
// we only want to copy the summary title, which is the first child
 
// node.
 
const title = $summary[0]?.firstChild?.textContent || '';
const verticalTab = new Drupal.verticalTab({
const verticalTab = new Drupal.verticalTab({
title: $summary.length ? $summary[0].textContent : '',
title,
details: $that,
details: $that,
});
});
tabList.append(verticalTab.item);
tabList.append(verticalTab.item);
Loading