1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 10:52:41 +01:00
phorge-phorge/webroot/rsrc/js/application/projects/behavior-boards-dropdown.js

36 lines
771 B
JavaScript
Raw Normal View History

/**
* @provides javelin-behavior-boards-dropdown
* @requires javelin-behavior
* javelin-dom
* javelin-stratcom
* phuix-dropdown-menu
*/
JX.behavior('boards-dropdown', function() {
JX.Stratcom.listen('click', 'boards-dropdown-menu', function(e) {
var data = e.getNodeData('boards-dropdown-menu');
if (data.menu) {
return;
}
e.kill();
var list = JX.$H(data.items).getFragment().firstChild;
var button = e.getNode('boards-dropdown-menu');
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();
});
});
});