From 7ea1f2a7dc3c091243cc3c75d5ce08243edb5aaa Mon Sep 17 00:00:00 2001 From: Matthew Harrison-Jones Date: Mon, 13 May 2013 18:45:59 +0100 Subject: [PATCH] Remeber the last settings location --- core/admin/assets/js/settings.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/admin/assets/js/settings.js b/core/admin/assets/js/settings.js index 6ad3eb1159..d28d068ed0 100644 --- a/core/admin/assets/js/settings.js +++ b/core/admin/assets/js/settings.js @@ -1,4 +1,4 @@ -/*globals document, jQuery */ +/*globals document, location, jQuery */ (function ($) { "use strict"; @@ -7,6 +7,7 @@ e.preventDefault(); $('.settings-menu .active').removeClass('active'); + location.hash = $(this).attr('class'); // Placed here so never gets given the active attribute. $(this).addClass('active'); $('.settings-content').fadeOut().delay(250); @@ -14,7 +15,16 @@ }; - $(document).ready(function() { + $(document).ready(function () { + if (location.hash) { + var page = $(".settings-menu li." + location.hash.replace('#', '')), + newPage = page.children('a').attr('href'); + $('.settings-menu .active').removeClass('active'); + page.addClass('active'); + + $('.settings-content').hide().delay(250); + $(newPage).show(); + } $('.settings-menu li').on('click', changePage); $('input').iCheck({