1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix "choose icon" on profile menu items

Summary:
Ref T10054. This fix is a little rough but the "right" fix involves a ton of rewriting to `AphrontSideNavFilterView` and I don't want to open that can of worms up yet.

Specifically, the problem is:

  - we build the menu in order to populate the mobile/application menu;
  - as a side effect of building the menu (not rendering the menu), we initialize the menu collapse/expand behavior;
  - but we never actually render the menu, so the `JX.$()` call fails.

The right fix would be to initialize the behavior only when we render the menu, but then `AphorntSideNavFilterView` would need to know about profile menu behaviors. It probably should some day, but I think today is not that day.

Test Plan: Set icons on a link on a profile menu.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10054

Differential Revision: https://secure.phabricator.com/D15073
This commit is contained in:
epriestley 2016-01-21 10:02:01 -08:00
parent b51a859636
commit 88e2929411
2 changed files with 15 additions and 4 deletions

View file

@ -500,7 +500,7 @@ return array(
'rsrc/js/core/phtize.js' => 'd254d646',
'rsrc/js/phui/behavior-phui-dropdown-menu.js' => '54733475',
'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836',
'rsrc/js/phui/behavior-phui-profile-menu.js' => 'bf2c93d6',
'rsrc/js/phui/behavior-phui-profile-menu.js' => 'bfc2e675',
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262',
'rsrc/js/phuix/PHUIXAutocomplete.js' => '21dc9144',
@ -649,7 +649,7 @@ return array(
'javelin-behavior-pholio-mock-view' => 'fbe497e7',
'javelin-behavior-phui-dropdown-menu' => '54733475',
'javelin-behavior-phui-object-box-tabs' => '2bfa2836',
'javelin-behavior-phui-profile-menu' => 'bf2c93d6',
'javelin-behavior-phui-profile-menu' => 'bfc2e675',
'javelin-behavior-policy-control' => 'ae45872f',
'javelin-behavior-policy-rule-editor' => '5e9f347c',
'javelin-behavior-project-boards' => 'ba4fa35c',
@ -1774,7 +1774,7 @@ return array(
'javelin-util',
'javelin-request',
),
'bf2c93d6' => array(
'bfc2e675' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',

View file

@ -6,7 +6,18 @@
*/
JX.behavior('phui-profile-menu', function(config) {
var menu_node = JX.$(config.menuID);
// NOTE: This behavior is not initialized in the rendering pipeline for the
// menu, so it can get initialized when we build but do not render a menu
// (for example, when a page like the panel edit page only has items in
// the mobile/application menu, and does not show the profile menu). For now,
// just bail if we can't find the menu.
try {
var menu_node = JX.$(config.menuID);
} catch (ex) {
return;
}
var collapse_node = JX.$(config.collapseID);
var is_collapsed = config.isCollapsed;