From 01834935ca588f2a49ba285bbb87f1e4a9b96693 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 7 Mar 2017 12:10:00 +0200 Subject: [PATCH] Use last settings page with GS shortcut --- resources/views/accounts/nav.blade.php | 26 +++++++++++++++---- resources/views/header.blade.php | 3 +++ .../partials/keyboard_shortcuts.blade.php | 6 ++++- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/resources/views/accounts/nav.blade.php b/resources/views/accounts/nav.blade.php index 338a7b462a05..e0ab9168bcb9 100644 --- a/resources/views/accounts/nav.blade.php +++ b/resources/views/accounts/nav.blade.php @@ -1,11 +1,27 @@ @if (!Utils::isPro() && isset($advanced) && $advanced) -
-
- {!! trans('texts.pro_plan_advanced_settings', ['link'=>'' . trans('texts.pro_plan_remove_logo_link') . '']) !!} -
-
+
+
+ {!! trans('texts.pro_plan_advanced_settings', ['link'=>'' . trans('texts.pro_plan_remove_logo_link') . '']) !!} +
+
@endif + +
diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index b1d3504f54c7..d8066601e022 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -337,6 +337,9 @@ if (history.pushState) { history.pushState(null, null, target); } + if (isStorageSupported() && /\/settings\//.test(location.href)) { + localStorage.setItem('last:settings_page', location.href); + } }); }); diff --git a/resources/views/partials/keyboard_shortcuts.blade.php b/resources/views/partials/keyboard_shortcuts.blade.php index f708d5fe0b7d..9f635d606171 100644 --- a/resources/views/partials/keyboard_shortcuts.blade.php +++ b/resources/views/partials/keyboard_shortcuts.blade.php @@ -103,7 +103,11 @@ }); Mousetrap.bind('g s', function(e) { - location.href = "{{ url('/settings/company_details') }}"; + var url = '{{ url('/settings/company_details') }}'; + if (isStorageSupported()) { + url = localStorage.getItem('last:settings_page') || url; + } + location.href = url; }); Mousetrap.bind('h', function(e) {