2014-05-20 20:42:05 +02:00
|
|
|
/**
|
2014-06-25 21:30:53 +02:00
|
|
|
* @provides javelin-behavior-boards-dropdown
|
2014-05-20 20:42:05 +02:00
|
|
|
* @requires javelin-behavior
|
|
|
|
* javelin-dom
|
|
|
|
* javelin-stratcom
|
|
|
|
* phuix-dropdown-menu
|
|
|
|
*/
|
|
|
|
|
2014-06-25 21:30:53 +02:00
|
|
|
JX.behavior('boards-dropdown', function() {
|
2014-05-20 20:42:05 +02:00
|
|
|
|
2014-06-25 21:30:53 +02:00
|
|
|
JX.Stratcom.listen('click', 'boards-dropdown-menu', function(e) {
|
|
|
|
var data = e.getNodeData('boards-dropdown-menu');
|
2014-05-20 20:42:05 +02:00
|
|
|
if (data.menu) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
e.kill();
|
|
|
|
|
|
|
|
var list = JX.$H(data.items).getFragment().firstChild;
|
|
|
|
|
2014-06-25 21:30:53 +02:00
|
|
|
var button = e.getNode('boards-dropdown-menu');
|
2014-05-20 20:42:05 +02:00
|
|
|
data.menu = new JX.PHUIXDropdownMenu(button);
|
|
|
|
data.menu.setContent(list);
|
|
|
|
data.menu.open();
|
|
|
|
|
|
|
|
JX.DOM.listen(list, 'click', 'tag:a', function(e) {
|
|
|
|
if (!e.isNormalClick()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
data.menu.close();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|