diff --git a/services/web/app/views/_scripts/active_tab.pug b/services/web/app/views/_scripts/active_tab.pug index d79159739a..c54832586a 100644 --- a/services/web/app/views/_scripts/active_tab.pug +++ b/services/web/app/views/_scripts/active_tab.pug @@ -1,10 +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 +//- 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 diff --git a/services/web/public/coffee/directives/bookmarkableTabset.coffee b/services/web/public/coffee/directives/bookmarkableTabset.coffee index a0e6dc3640..84251075df 100644 --- a/services/web/public/coffee/directives/bookmarkableTabset.coffee +++ b/services/web/public/coffee/directives/bookmarkableTabset.coffee @@ -12,6 +12,7 @@ define [ tab.bookmarkableTabId == hash if matchingTab? matchingTab.select() + el.children()[0].scrollIntoView({ behavior: "smooth" }) App.directive "bookmarkableTab", ($location) -> restrict: "A" @@ -22,7 +23,7 @@ define [ if tabScope? and tabId? and tabId != "" tabScope.bookmarkableTabId = tabId tabScope.$watch "active", (isActive, wasActive) -> - if isActive and !wasActive + if isActive and !wasActive and $location.hash() != tabId $location.hash tabId