From e97f0684ac2c7ea25f399a0db6f726a3f9b2d715 Mon Sep 17 00:00:00 2001 From: Justin McCarthy Date: Thu, 17 May 2018 22:46:17 -0700 Subject: [PATCH] move all calls to show to bottom block --- example/templates/index.ace | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/example/templates/index.ace b/example/templates/index.ace index c0dd9fe..53e2951 100644 --- a/example/templates/index.ace +++ b/example/templates/index.ace @@ -15,20 +15,11 @@ html lang=en document.querySelectorAll('.cron').forEach(function(el) { el.innerHTML = prettyCron.toString((""+el.innerHTML).trim(),true) // 6-field expressions }) - if (window.location.hash != "") { - var hashComponents = window.location.hash.split('#') - if (hashComponents.length>1) { - var destination = hashComponents[1] - if (["overview","narratives","policies","procedures","standards"].indexOf(destination) >= 0) { - show(destination) - } - } - } }) function show(name) { - if(history.replaceState) { - history.replaceState(null, null, '#'+name); + if (history.replaceState) { + history.replaceState(null, null, '#'+name) } var items = document.getElementsByClassName('top-nav') @@ -233,7 +224,14 @@ html lang=en .content.has-text-centered p {{.Project.OrganizationName}} Confidential 2018 = javascript - // commented for development if (window.location.hash=="") { show('overview') + } else { + var hashComponents = window.location.hash.split('#') + if (hashComponents.length>1) { + var destination = hashComponents[1] + if (["overview","narratives","policies","procedures","standards"].indexOf(destination) >= 0) { + show(destination) + } + } } \ No newline at end of file