[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 /** 2 * @provides javelin-behavior-dashboard-tab-panel 3 * @requires javelin-behavior 4 * javelin-dom 5 * javelin-stratcom 6 */ 7 8 JX.behavior('dashboard-tab-panel', function() { 9 10 JX.Stratcom.listen('click', 'dashboard-tab-panel-tab', function(e) { 11 e.kill(); 12 13 var ii; 14 var idx = e.getNodeData('dashboard-tab-panel-tab').idx; 15 16 var root = e.getNode('dashboard-tab-panel-container'); 17 var data = JX.Stratcom.getData(root); 18 19 // Give the tab the user clicked a selected style, and remove it from 20 // the other tabs. 21 var tabs = JX.DOM.scry(root, 'li', 'dashboard-tab-panel-tab'); 22 for (ii = 0; ii < tabs.length; ii++) { 23 JX.DOM.alterClass(tabs[ii], 'phui-list-item-selected', (ii == idx)); 24 } 25 26 // Switch the visible content to correspond to whatever the user clicked. 27 for (ii = 0; ii < data.panels.length; ii++) { 28 var panel = JX.$(data.panels[ii]); 29 if (ii == idx) { 30 JX.DOM.show(panel); 31 } else { 32 JX.DOM.hide(panel); 33 } 34 } 35 36 }); 37 38 });
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |