diff -u b/core/modules/toolbar/js/toolbar.es6.js b/core/modules/toolbar/js/toolbar.es6.js --- b/core/modules/toolbar/js/toolbar.es6.js +++ b/core/modules/toolbar/js/toolbar.es6.js @@ -143,7 +143,7 @@ if (Drupal.toolbar.models.toolbarModel.get('orientation') === 'horizontal' && Drupal.toolbar.models.toolbarModel.get('activeTab') === null) { const firstItem = $('.toolbar-bar .toolbar-tab:not(.home-toolbar-tab) a'); const attr = firstItem.attr('data-toolbar-tray'); - if (typeof attr !== typeof undefined && attr !== false) { + if (attr !== undefined) { Drupal.toolbar.models.toolbarModel.set({ activeTab: firstItem.get(0), }); diff -u b/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js --- b/core/modules/toolbar/js/toolbar.js +++ b/core/modules/toolbar/js/toolbar.js @@ -4,7 +4,6 @@ * https://www.drupal.org/node/2815083 * @preserve **/ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; (function ($, Drupal, drupalSettings) { var options = $.extend({ @@ -98,7 +97,7 @@ if (Drupal.toolbar.models.toolbarModel.get('orientation') === 'horizontal' && Drupal.toolbar.models.toolbarModel.get('activeTab') === null) { var firstItem = $('.toolbar-bar .toolbar-tab:not(.home-toolbar-tab) a'); var attr = firstItem.attr('data-toolbar-tray'); - if ((typeof attr === 'undefined' ? 'undefined' : _typeof(attr)) !== (typeof undefined === 'undefined' ? 'undefined' : _typeof(undefined)) && attr !== false) { + if (attr !== undefined) { Drupal.toolbar.models.toolbarModel.set({ activeTab: firstItem.get(0) }); diff -u b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php --- b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php +++ b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php @@ -32,7 +32,7 @@ $session = $this->getSession(); $result = $session->evaluateScript("Drupal.toolbar.models.toolbarModel.get('activeTab').id"); - // Ensure that the administration is active by default. + // Ensure that the administration toolbar tab is active by default. $this->assertEquals('toolbar-item-administration', $result); // Test that it is possible to toggle the toolbar tray.