aboutsummaryrefslogtreecommitdiff
path: root/webgui/data/tabs.js
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-26 00:35:57 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-26 00:35:57 +0000
commit4affa4001afa5cad8ed2e8cd865fae21812badce (patch)
tree6aad35eb4b8f70451e35c6030b881c77ffbcb5cb /webgui/data/tabs.js
parent8640e03551a8da768291c4b02eb5eae8742e3b45 (diff)
downloadthermoprint-4affa4001afa5cad8ed2e8cd865fae21812badce.tar
thermoprint-4affa4001afa5cad8ed2e8cd865fae21812badce.tar.gz
thermoprint-4affa4001afa5cad8ed2e8cd865fae21812badce.tar.bz2
thermoprint-4affa4001afa5cad8ed2e8cd865fae21812badce.tar.xz
thermoprint-4affa4001afa5cad8ed2e8cd865fae21812badce.zip
View job contents
Diffstat (limited to 'webgui/data/tabs.js')
-rw-r--r--webgui/data/tabs.js27
1 files changed, 18 insertions, 9 deletions
diff --git a/webgui/data/tabs.js b/webgui/data/tabs.js
index 1d178d9..0cdb8e5 100644
--- a/webgui/data/tabs.js
+++ b/webgui/data/tabs.js
@@ -1,13 +1,22 @@
1jQuery(document).ready(function() { 1jQuery(document).ready(function() {
2 jQuery('.tabs .tab-links a').on('click', function(e) { 2 jQuery('.tabs .tabLinks a').on('click', switchTab);
3 var currentAttrValue = jQuery(this).attr('href'); 3
4 var observer = new window.MutationObserver(function(mutations, observer) {
5 jQuery('.tabs .tabLinks a').on('click', switchTab);
6 });
7 jQuery('.tabLinks').each( function () {
8 observer.observe(this, { childList: true, subtree: true });
9 });
10});
11
12function switchTab(e) {
13 var currentAttrValue = jQuery(this).attr('href');
4 14
5 // Show/Hide Tabs 15 // Show/Hide Tabs
6 jQuery('.tabs ' + currentAttrValue).show().siblings().hide(); 16 jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
7 17
8 // Change/remove current tab to active 18 // Change/remove current tab to active
9 jQuery(this).parent('li').addClass('active').siblings().removeClass('active'); 19 jQuery(this).parent('li').addClass('active').siblings().removeClass('active');
10 20
11 e.preventDefault(); 21 e.preventDefault();
12 }); 22}
13});