mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 23:31:03 +01:00
0a554c2ed5
Summary: Ref T10054. I think this gets everything except: - circles on icons; - I spent ~15 minutes poking at animations but wasn't able to get anything that looked reasonable whatsoever. Test Plan: - Collapsed menus. - Expanded menus. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10054 Differential Revision: https://secure.phabricator.com/D15056
28 lines
746 B
JavaScript
28 lines
746 B
JavaScript
/**
|
|
* @provides javelin-behavior-phui-profile-menu
|
|
* @requires javelin-behavior
|
|
* javelin-stratcom
|
|
* javelin-dom
|
|
*/
|
|
|
|
JX.behavior('phui-profile-menu', function(config) {
|
|
var menu_node = JX.$(config.menuID);
|
|
var collapse_node = JX.$(config.collapseID);
|
|
|
|
var is_collapsed = config.isCollapsed;
|
|
|
|
JX.DOM.listen(collapse_node, 'click', null, function(e) {
|
|
is_collapsed = !is_collapsed;
|
|
JX.DOM.alterClass(menu_node, 'phui-profile-menu-collapsed', is_collapsed);
|
|
JX.DOM.alterClass(menu_node, 'phui-profile-menu-expanded', !is_collapsed);
|
|
|
|
if (config.settingsURI) {
|
|
new JX.Request(config.settingsURI)
|
|
.setData({value: (is_collapsed ? 1 : 0)})
|
|
.send();
|
|
}
|
|
|
|
e.kill();
|
|
});
|
|
|
|
});
|