From 5ad847b113409d9cd2638a3e3880519dcf29d02e Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Thu, 16 Nov 2017 17:30:24 -0500 Subject: [PATCH] Replace state on initial page load so it's reloadable on popstate --- docs/source/_assets/js/nav.js | 7 +++++++ docs/source/_layouts/documentation.blade.php | 4 ++++ docs/source/_layouts/master.blade.php | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/source/_assets/js/nav.js b/docs/source/_assets/js/nav.js index 4eb26411a..0f58a238b 100644 --- a/docs/source/_assets/js/nav.js +++ b/docs/source/_assets/js/nav.js @@ -1,4 +1,11 @@ $.when($.ready).then(function() { + window.history.replaceState({ + 'href': window.location.href, + 'title': $(document).filter('title').text(), + 'nav': $(document).find('#nav').html(), + 'content': $(document).find('#content').html() + }, '', window.location.href) + $('#nav').on('click', 'a', function (event) { // Allow opening links in new tabs diff --git a/docs/source/_layouts/documentation.blade.php b/docs/source/_layouts/documentation.blade.php index 720f144b8..e1d5936d4 100644 --- a/docs/source/_layouts/documentation.blade.php +++ b/docs/source/_layouts/documentation.blade.php @@ -14,6 +14,10 @@ @endsection +@push('headScripts') + +@endpush + @section('body')