From 0aa266d093fec3c03d941506b0401b0025bf176c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 5 Sep 2016 21:51:00 +0300 Subject: [PATCH] Add hash when selecting nav tab --- resources/views/header.blade.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 00afc38443..c5e4979823 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -493,9 +493,16 @@ thead th { setTimeout(function() { $('.nav-tabs a[href="' + window.location.hash + '"]').tab('show'); }, 1); - } + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + var target = $(e.target).attr("href") // activated tab + console.log(target); + var scrollmem = $('html,body').scrollTop(); + window.location.hash = target; + $('html,body').scrollTop(scrollmem); + }); + });