Skip to content
Permalink
Browse files

Website link should return to last non-admin page visited

  • Loading branch information...
jbroadway committed May 22, 2013
1 parent 05d99ba commit cde952acff530123d635231b6f1a8ac342980bad
Showing with 11 additions and 3 deletions.
  1. +9 −1 apps/admin/js/top-bar.js
  2. +1 −1 apps/admin/views/head/links.html
  3. +1 −1 layouts/admin.html
@@ -157,7 +157,6 @@ $(function () {
$('#admin-logo').attr ('src', res.logo).attr ('alt', res.name);
$('#admin-links').append (res.links);


$('#admin-tools').hover (
function () {
$('#admin-tools-list').stop ().css("height","auto").slideDown ('fast');
@@ -169,6 +168,15 @@ $(function () {
$('#admin-links a').not('#admin-tools-list a').bind("mouseover", function(){
$('#admin-tools-list').stop ().slideUp ('slow');
});

// website link should open to the last non-admin page visited
var last_page = $('body').data ('admin-last-page');
if (last_page) {
$('#admin-tools-website').attr ('href', last_page);
} else {
$.cookie ('elefant_last_page', window.location.pathname, { path: '/' });
$('#admin-tools-website').attr ('href', window.location.pathname);
}
});
$('.admin-options a').hover (
function () {
@@ -1,4 +1,4 @@
<a href="/">{"Website"}</a>
<a href="/" id="admin-tools-website">{"Website"}</a>
<span id="admin-tools">{"Tools"} <strong>&or;</strong>
<ul id="admin-tools-list">
{% foreach tools %}
2 layouts/admin.html 100644 → 100755
@@ -11,7 +11,7 @@
{! admin/head !}
{{ head|none }}
</head>
<body>
<body data-admin-last-page="{{ isset ($_COOKIE['elefant_last_page']) ? $_COOKIE['elefant_last_page'] : '' }}">
<div id="wrapper" class="container_12">
<div id="body" class="grid_12">
{% if title != '' %}<h2>{{ title|none }}</h2>{% end %}

0 comments on commit cde952a

Please sign in to comment.
You can’t perform that action at this time.