From bec50892deac436e3b1a98473906623fd521156a Mon Sep 17 00:00:00 2001 From: Jessica Lawshe Date: Wed, 19 Sep 2018 17:58:07 -0500 Subject: [PATCH] Linkable tabs --- services/web/app/views/_scripts/active_tab.pug | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 services/web/app/views/_scripts/active_tab.pug diff --git a/services/web/app/views/_scripts/active_tab.pug b/services/web/app/views/_scripts/active_tab.pug new file mode 100644 index 0000000000..290505d6cb --- /dev/null +++ b/services/web/app/views/_scripts/active_tab.pug @@ -0,0 +1,10 @@ +script(type="text/javascript"). + if (window.location.hash) { + setTimeout(function(){ + tabID = window.location.hash.replace('#', '') + tab = document.getElementById(tabID) + if (tab && typeof(tab) != 'undefined' && tab != null) { + tab.setAttribute('active', true) + } + }, 500); + } \ No newline at end of file