diff --git a/core/lib/Drupal/Core/Render/Element/StatusReport.php b/core/lib/Drupal/Core/Render/Element/StatusReport.php index ac548bd..5aa50ab 100644 --- a/core/lib/Drupal/Core/Render/Element/StatusReport.php +++ b/core/lib/Drupal/Core/Render/Element/StatusReport.php @@ -34,7 +34,7 @@ public function getInfo() { * #pre_render callback to group requirements. */ public static function preRenderGroupRequirements($element) { - $severities = static::getServerities(); + $severities = static::getSeverities(); $grouped_requirements = []; foreach ($element['#requirements'] as $key => $requirement) { @@ -67,7 +67,7 @@ public static function preRenderGroupRequirements($element) { * * @return array */ - public static function getServerities() { + public static function getSeverities() { return [ REQUIREMENT_INFO => [ 'title' => t('Checked'), diff --git a/core/modules/system/src/Element/StatusReportPage.php b/core/modules/system/src/Element/StatusReportPage.php index 1f627e2..5d2f985 100644 --- a/core/modules/system/src/Element/StatusReportPage.php +++ b/core/modules/system/src/Element/StatusReportPage.php @@ -91,7 +91,7 @@ public static function preRenderCounters($element) { ], ]; - $severities = StatusReport::getServerities(); + $severities = StatusReport::getSeverities(); foreach ($element['#requirements'] as $key => &$requirement) { $severity = $severities[REQUIREMENT_INFO]; if (isset($requirement['severity'])) { diff --git a/core/themes/seven/js/nav-tabs.js b/core/themes/seven/js/nav-tabs.js index ba44ffb..8e3e939 100644 --- a/core/themes/seven/js/nav-tabs.js +++ b/core/themes/seven/js/nav-tabs.js @@ -44,6 +44,7 @@ attach: function (context, settings) { var $tabs = $(context).find('[data-drupal-nav-tabs]'); if ($tabs.length) { + console.log($tabs); var notSmartPhone = window.matchMedia('(min-width: 300px)'); if (notSmartPhone.matches) { $tabs.once('nav-tabs').each(init); diff --git a/core/themes/seven/js/responsive-details.js b/core/themes/seven/js/responsive-details.js index e3a10a5..f9ecd71 100644 --- a/core/themes/seven/js/responsive-details.js +++ b/core/themes/seven/js/responsive-details.js @@ -3,7 +3,7 @@ * Provides responsive behaviors to HTML details elements. */ -(function ($, Drupal, debounce) { +(function ($, Drupal) { 'use strict'; @@ -18,9 +18,10 @@ Drupal.behaviors.responsiveDetails = { attach: function (context) { var $statusDetails = $(context).find('details').once('responsive-details'); + var mql = window.matchMedia('(min-width:48em)'); - function handleResize() { - if (window.matchMedia('(min-width:48em)').matches) { + function handleResize(mql) { + if (mql.matches) { $statusDetails .attr('open', true) .children('summary') @@ -37,8 +38,9 @@ } } - $(window).on('resize.details', debounce(handleResize, 150)).trigger('resize.details'); + mql.addListener(handleResize); + handleResize(mql); } }; -})(jQuery, Drupal, Drupal.debounce); +})(jQuery, Drupal); diff --git a/core/themes/seven/seven.libraries.yml b/core/themes/seven/seven.libraries.yml index f5b78d3..968579b 100644 --- a/core/themes/seven/seven.libraries.yml +++ b/core/themes/seven/seven.libraries.yml @@ -77,6 +77,7 @@ drupal.nav-tabs: - core/drupal - core/jquery.once - core/drupal.debounce + - core/collapse drupal.responsive-detail: version: VERSION @@ -84,9 +85,10 @@ drupal.responsive-detail: js/responsive-details.js: {} dependencies: - core/matchmedia + - core/matchmedia.addListener - core/jquery - core/jquery.once - - core/drupal.debounce + - core/collapse vertical-tabs: version: VERSION diff --git a/core/themes/stable/stable.theme b/core/themes/stable/stable.theme index 108798e..b3b633d 100644 --- a/core/themes/stable/stable.theme +++ b/core/themes/stable/stable.theme @@ -6,6 +6,7 @@ */ use Drupal\Component\Utility\Html; +use Drupal\Core\Render\Element\StatusReport; /** * Implements hook_theme_registry_alter(). @@ -55,24 +56,7 @@ function stable_preprocess_links(&$variables) { * - REQUIREMENT_ERROR: The requirement failed with an error. */ function template_preprocess_status_report(&$variables) { - $severities = [ - REQUIREMENT_INFO => [ - 'title' => t('Info'), - 'status' => 'info', - ], - REQUIREMENT_OK => [ - 'title' => t('OK'), - 'status' => 'ok', - ], - REQUIREMENT_WARNING => [ - 'title' => t('Warning'), - 'status' => 'warning', - ], - REQUIREMENT_ERROR => [ - 'title' => t('Error'), - 'status' => 'error', - ], - ]; + $severities = StatusReport::getSeverities(); if (empty($variables['requirements'])) { $variables['requirements'] = [];