2013-10-19 21:07:50 +02:00
|
|
|
/**
|
2016-07-01 01:55:28 +02:00
|
|
|
* @provides javelin-behavior-phui-tab-group
|
2013-10-19 21:07:50 +02:00
|
|
|
* @requires javelin-behavior
|
|
|
|
* javelin-stratcom
|
|
|
|
* javelin-dom
|
|
|
|
*/
|
|
|
|
|
2016-07-01 01:55:28 +02:00
|
|
|
JX.behavior('phui-tab-group', function() {
|
2013-10-19 21:07:50 +02:00
|
|
|
|
|
|
|
JX.Stratcom.listen(
|
|
|
|
'click',
|
2016-07-01 01:55:28 +02:00
|
|
|
'phui-tab-view',
|
2013-10-19 21:07:50 +02:00
|
|
|
function (e) {
|
2014-08-01 21:29:48 +02:00
|
|
|
e.kill();
|
2013-10-19 21:07:50 +02:00
|
|
|
|
2016-07-01 01:55:28 +02:00
|
|
|
var map = e.getNodeData('phui-tab-group-view').tabMap;
|
|
|
|
var key = e.getNodeData('phui-tab-view').tabKey;
|
|
|
|
|
|
|
|
var group = e.getNode('phui-tab-group-view');
|
|
|
|
var tab = e.getNode('phui-tab-view');
|
|
|
|
var tabs = JX.DOM.scry(group, 'li', 'phui-tab-view');
|
|
|
|
|
2013-10-19 21:07:50 +02:00
|
|
|
for (var ii = 0; ii < tabs.length; ii++) {
|
|
|
|
JX.DOM.alterClass(
|
|
|
|
tabs[ii],
|
|
|
|
'phui-list-item-selected',
|
|
|
|
(tabs[ii] == tab));
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var k in map) {
|
|
|
|
if (k == key) {
|
|
|
|
JX.DOM.show(JX.$(map[k]));
|
|
|
|
} else {
|
|
|
|
JX.DOM.hide(JX.$(map[k]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|