2013-11-26 22:06:57 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
2015-06-06 15:55:42 +00:00
|
|
|
|
2013-11-26 22:06:57 +00:00
|
|
|
(function ($, Drupal, drupalSettings) {
|
2014-01-27 21:41:32 +00:00
|
|
|
var pathInfo = drupalSettings.path;
|
|
|
|
var escapeAdminPath = sessionStorage.getItem('escapeAdminPath');
|
2014-02-03 14:42:59 +00:00
|
|
|
var windowLocation = window.location;
|
2013-11-26 22:06:57 +00:00
|
|
|
|
2014-02-03 14:42:59 +00:00
|
|
|
if (!pathInfo.currentPathIsAdmin && !/destination=/.test(windowLocation.search)) {
|
2014-03-12 19:09:45 +00:00
|
|
|
sessionStorage.setItem('escapeAdminPath', windowLocation);
|
2014-01-27 21:41:32 +00:00
|
|
|
}
|
2013-11-26 22:06:57 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.behaviors.escapeAdmin = {
|
2017-05-19 22:12:53 +00:00
|
|
|
attach: function attach() {
|
2014-01-27 21:41:32 +00:00
|
|
|
var $toolbarEscape = $('[data-toolbar-escape-admin]').once('escapeAdmin');
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2014-10-03 16:04:47 +00:00
|
|
|
if ($toolbarEscape.length && pathInfo.currentPathIsAdmin) {
|
|
|
|
if (escapeAdminPath !== null) {
|
2014-03-12 19:09:45 +00:00
|
|
|
$toolbarEscape.attr('href', escapeAdminPath);
|
2017-05-19 22:12:53 +00:00
|
|
|
} else {
|
2014-10-03 16:04:47 +00:00
|
|
|
$toolbarEscape.text(Drupal.t('Home'));
|
|
|
|
}
|
2013-11-26 22:06:57 +00:00
|
|
|
}
|
|
|
|
}
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery, Drupal, drupalSettings);
|