X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftoolbar%2Fjs%2FescapeAdmin.es6.js;h=c91c9d847c4e8876ae3641190e0f52a91b70fced;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=c381f021c7085151910e92c80a9f8da15360058a;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/toolbar/js/escapeAdmin.es6.js b/web/core/modules/toolbar/js/escapeAdmin.es6.js index c381f021c..c91c9d847 100644 --- a/web/core/modules/toolbar/js/escapeAdmin.es6.js +++ b/web/core/modules/toolbar/js/escapeAdmin.es6.js @@ -3,7 +3,7 @@ * Replaces the home link in toolbar with a back to site link. */ -(function ($, Drupal, drupalSettings) { +(function($, Drupal, drupalSettings) { const pathInfo = drupalSettings.path; const escapeAdminPath = sessionStorage.getItem('escapeAdminPath'); const windowLocation = window.location; @@ -12,7 +12,10 @@ // back to it when browsing administrative pages. If there is a destination // parameter there is not need to save the current path because the page is // loaded within an existing "workflow". - if (!pathInfo.currentPathIsAdmin && !/destination=/.test(windowLocation.search)) { + if ( + !pathInfo.currentPathIsAdmin && + !/destination=/.test(windowLocation.search) + ) { sessionStorage.setItem('escapeAdminPath', windowLocation); } @@ -29,15 +32,16 @@ */ Drupal.behaviors.escapeAdmin = { attach() { - const $toolbarEscape = $('[data-toolbar-escape-admin]').once('escapeAdmin'); + const $toolbarEscape = $('[data-toolbar-escape-admin]').once( + 'escapeAdmin', + ); if ($toolbarEscape.length && pathInfo.currentPathIsAdmin) { if (escapeAdminPath !== null) { $toolbarEscape.attr('href', escapeAdminPath); - } - else { + } else { $toolbarEscape.text(Drupal.t('Home')); } } }, }; -}(jQuery, Drupal, drupalSettings)); +})(jQuery, Drupal, drupalSettings);