Chris@0: /** Chris@0: * DO NOT EDIT THIS FILE. Chris@0: * See the following change record for more information, Chris@0: * https://www.drupal.org/node/2815083 Chris@0: * @preserve Chris@0: **/ Chris@0: Chris@0: (function ($, Drupal, drupalSettings) { Chris@0: var pathInfo = drupalSettings.path; Chris@0: var escapeAdminPath = sessionStorage.getItem('escapeAdminPath'); Chris@0: var windowLocation = window.location; Chris@0: Chris@0: if (!pathInfo.currentPathIsAdmin && !/destination=/.test(windowLocation.search)) { Chris@0: sessionStorage.setItem('escapeAdminPath', windowLocation); Chris@0: } Chris@0: Chris@0: Drupal.behaviors.escapeAdmin = { Chris@0: attach: function attach() { Chris@0: var $toolbarEscape = $('[data-toolbar-escape-admin]').once('escapeAdmin'); Chris@0: if ($toolbarEscape.length && pathInfo.currentPathIsAdmin) { Chris@0: if (escapeAdminPath !== null) { Chris@0: $toolbarEscape.attr('href', escapeAdminPath); Chris@0: } else { Chris@0: $toolbarEscape.text(Drupal.t('Home')); Chris@0: } Chris@0: } Chris@0: } Chris@0: }; Chris@0: })(jQuery, Drupal, drupalSettings);