Ver código fonte

Linkable tabs

Jessica Lawshe 8 anos atrás
pai
commit
bec50892de
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      services/web/app/views/_scripts/active_tab.pug

+ 10 - 0
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);
+	}