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roup || {};\n Drupal.FieldGroup.Effects = Drupal.FieldGroup.Effects || {};\n\n /**\n * This script transforms a set of fieldsets into a stack of horizontal\n * tabs. Another tab pane can be selected by clicking on the respective\n * tab.\n *\n * Each tab may have a summary which can be updated by another\n * script. For that to work, each fieldset has an associated\n * 'horizontalTabCallback' (with jQuery.data() attached to the fieldset),\n * which is called every time the user performs an update to a form\n * element inside the tab pane.\n */\n Drupal.behaviors.horizontalTabs = {\n attach: function (context) {\n\n var width = drupalSettings.widthBreakpoint || 640;\n var mq = '(max-width: ' + width + 'px)';\n\n if (window.matchMedia(mq).matches) {\n // return;\n }\n\n $(once('horizontal-tabs', '[data-horizontal-tabs-panes]', context)).each(function() {\n //$(context).find('[data-horizontal-tabs-panes]').once('horizontal-tabs').each(function () {\n\n var $this = $(this).addClass('horizontal-tabs-panes');\n var focusID = $(':hidden.horizontal-tabs-active-tab', this).val();\n var tab_focus;\n\n // Check if there are some details that can be converted to horizontal-tabs\n var $details = $this.find('> details');\n if ($details.length === 0) {\n return;\n }\n\n // If collapse.js did not do his work yet, call it directly.\n // commenting this out as collapse.js is not present in D10 - Jordon\n // if (!$($details[0]).hasClass('.collapse-processed')) {\n // Drupal.behaviors.collapse.attach(context);\n // }\n\n // Create the tab column.\n var tab_list = $('');\n $(this).wrap('
').before(tab_list);\n\n // Transform each details into a tab.\n $details.each(function (i) {\n var $this = $(this);\n var summaryElement = $this.find('> summary .details-title');\n\n if (!summaryElement.length) {\n summaryElement = $this.find('> summary');\n }\n\n var summaryText = summaryElement.clone().children().remove().end().text().trim() || summaryElement.find('> span:first-child').text().trim();\n var horizontal_tab = new Drupal.horizontalTab({\n title: summaryText,\n details: $this\n });\n horizontal_tab.item.addClass('horizontal-tab-button-' + i);\n tab_list.append(horizontal_tab.item);\n $this\n .removeClass('collapsed')\n // prop() can't be used on browsers not supporting details element,\n // the style won't apply to them if prop() is used.\n .attr('open', true)\n .addClass('horizontal-tabs-pane')\n .data('horizontalTab', horizontal_tab);\n if (this.id === focusID) {\n tab_focus = $this;\n }\n });\n\n $(tab_list).find('> li:first').addClass('first');\n $(tab_list).find('> li:last').addClass('last');\n\n if (!tab_focus) {\n // If the current URL has a fragment and one of the tabs contains an\n // element that matches the URL fragment, activate that tab.\n var hash = window.location.hash.replace(/[=%;,\\/]/g, '');\n if (hash !== '#' && $(this).find(hash).length) {\n tab_focus = $(this).find(hash).closest('.horizontal-tabs-pane');\n }\n else {\n tab_focus = $this.find('> .horizontal-tabs-pane:first');\n }\n }\n if (tab_focus.length) {\n tab_focus.data('horizontalTab').focus();\n }\n });\n }\n };\n\n /**\n * The horizontal tab object represents a single tab within a tab group.\n *\n * @param {object} settings\n * An object with the following keys:\n * - title: The name of the tab.\n * - details: The jQuery object of the details element that is the tab pane.\n */\n Drupal.horizontalTab = function (settings) {\n var self = this;\n $.extend(this, settings, Drupal.theme('horizontalTab', settings));\n\n this.link.attr('href', '#' + settings.details.attr('id'));\n\n this.link.on('click', function (e) {\n e.preventDefault();\n self.focus();\n });\n\n // Keyboard events added:\n // Pressing the Enter key will open the tab pane.\n this.link.on('keydown', function (event) {\n if (event.keyCode === 13) {\n event.preventDefault();\n self.focus();\n // Set focus on the first input field of the visible details/tab pane.\n $('.horizontal-tabs-pane :input:visible:enabled:first').trigger('focus');\n }\n });\n\n // Only bind update summary on forms.\n if (this.details.drupalGetSummary) {\n this.details\n .on('summaryUpdated', function () {\n self.updateSummary();\n })\n .trigger('summaryUpdated');\n }\n\n };\n\n Drupal.horizontalTab.prototype = {\n\n /**\n * Displays the tab's content pane.\n */\n focus: function () {\n this.details\n .removeClass('horizontal-tab-hidden')\n .siblings('.horizontal-tabs-pane')\n .each(function () {\n var tab = $(this).data('horizontalTab');\n tab.details.addClass('horizontal-tab-hidden');\n tab.details.hide();\n tab.item.removeClass('selected');\n })\n .end()\n .show()\n .siblings(':hidden.horizontal-tabs-active-tab')\n .val(this.details.attr('id'));\n this.item.addClass('selected');\n // Mark the active tab for screen readers.\n $('#active-horizontal-tab').remove();\n this.link.append('' + Drupal.t('(active tab)') + '');\n },\n\n /**\n * Updates the tab's summary.\n */\n updateSummary: function () {\n this.summary.html(this.details.drupalGetSummary());\n },\n\n /**\n * Shows a horizontal tab pane.\n *\n * @return {Drupal.horizontalTab} The current horizontal tab.\n */\n tabShow: function () {\n // Display the tab.\n this.item.removeClass('horizontal-tab-hidden');\n this.item.show();\n\n // Update .first marker for items. We need recurse from parent to retain the\n // actual DOM element order as jQuery implements sortOrder, but not as public\n // method.\n this.item.parent().children('.horizontal-tab-button').removeClass('first')\n .filter(':visible:first').addClass('first');\n // Display the details element.\n this.details.removeClass('horizontal-tab-hidden');\n // Focus this tab.\n this.focus();\n return this;\n },\n\n /**\n * Hides a horizontal tab pane.\n *\n * @return {Drupal.horizontalTab} The current horizontal tab.\n */\n tabHide: function () {\n // Hide this tab.\n this.item.addClass('horizontal-tab-hidden');\n this.item.hide();\n\n // Update .first marker for items. We need recurse from parent to retain the\n // actual DOM element order as jQuery implements sortOrder, but not as public\n // method.\n this.item.parent().children('.horizontal-tab-button').removeClass('first')\n .filter(':visible:first').addClass('first');\n // Hide the details element.\n this.details.addClass('horizontal-tab-hidden');\n // Focus the first visible tab (if there is one).\n var $firstTab = this.details.siblings('.horizontal-tabs-pane:not(.horizontal-tab-hidden):first');\n if ($firstTab.length) {\n $firstTab.data('horizontalTab').focus();\n }\n else {\n // Hide the vertical tabs (if no tabs remain).\n this.item.closest('.form-type-horizontal-tabs').hide();\n }\n return this;\n }\n };\n\n /**\n * Theme function for a horizontal tab.\n *\n * @param {object} settings\n * An object with the following keys:\n * - title: The name of the tab.\n * @return {object}\n * This function has to return an object with at least these keys:\n * - item: The root tab jQuery element\n * - link: The anchor tag that acts as the clickable area of the tab\n * (jQuery version)\n * - summary: The jQuery element that contains the tab summary\n */\n Drupal.theme.horizontalTab = function (settings) {\n var tab = {};\n var idAttr = settings.details.attr('id');\n\n tab.item = $('
  • ')\n .append(tab.link = $('')\n .append(tab.title = $('').text(settings.title))\n );\n\n // No need to add summary on frontend.\n if (settings.details.drupalGetSummary) {\n tab.link.append(tab.summary = $(''));\n }\n\n return tab;\n };\n\n})(jQuery, Drupal);\n"],"names":[],"version":3,"file":"horizontal-tabs-override.js.map"}