diff --git a/core/misc/vertical-tabs.es6.js b/core/misc/vertical-tabs.es6.js index c5980c4..f6c3dfa 100644 --- a/core/misc/vertical-tabs.es6.js +++ b/core/misc/vertical-tabs.es6.js @@ -81,6 +81,15 @@ title: $that.find('> summary').text(), details: $that, }); + + // If drupal states active for the summary, so add the same behavior for the li element + // to allow hide the vertical tab totally. + if ($that.attr('data-drupal-states')) { + vertical_tab.item.attr('data-drupal-states', $that.attr('data-drupal-states')); + // Add class to allow status js identify item with status options. + vertical_tab.item.addClass('js-form-item'); + } + tab_list.append(vertical_tab.item); $that .removeClass('collapsed') diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index ea89e85..f7828c9 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -42,6 +42,14 @@ title: $that.find('> summary').text(), details: $that }); + + // If drupal states active for the summary, so add the same behavior for the li element + // to allow hide the vertical tab totally. + if ($that.attr('data-drupal-states')) { + vertical_tab.item.attr('data-drupal-states', $that.attr('data-drupal-states')); + vertical_tab.item.addClass('js-form-item'); + } + tab_list.append(vertical_tab.item); $that.removeClass('collapsed').attr('open', true).addClass('vertical-tabs__pane').data('verticalTab', vertical_tab); if (this.id === focusID) {