@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement more correct white-icon menu behavior

Summary: I didn't get this quite right.

Test Plan:
- Clicked to open, saw white, then closed by:
- Clicking document outside menu;
- clicking menu icon again;
- clicking a different menu icon.
- In all three cases, got correct close + un-white behavior.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10967

+34 -26
+13 -13
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => 'a157f664', 11 - 'core.pkg.js' => 'e4556c9b', 11 + 'core.pkg.js' => 'da3ab00a', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '8af45893', 14 14 'differential.pkg.js' => '42c10e78', ··· 348 348 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 349 349 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 350 350 'rsrc/js/application/aphlict/Aphlict.js' => '4a07e8e3', 351 - 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '72118e8b', 351 + 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'f6bc26f0', 352 352 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'a826c925', 353 353 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '58f7803f', 354 354 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', ··· 542 542 'inline-comment-summary-css' => '8cfd34e8', 543 543 'javelin-aphlict' => '4a07e8e3', 544 544 'javelin-behavior' => '61cbc29a', 545 - 'javelin-behavior-aphlict-dropdown' => '72118e8b', 545 + 'javelin-behavior-aphlict-dropdown' => 'f6bc26f0', 546 546 'javelin-behavior-aphlict-listen' => 'a826c925', 547 547 'javelin-behavior-aphlict-status' => '58f7803f', 548 548 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', ··· 1278 1278 'phabricator-phtize', 1279 1279 'changeset-view-manager', 1280 1280 ), 1281 - '72118e8b' => array( 1282 - 'javelin-behavior', 1283 - 'javelin-request', 1284 - 'javelin-stratcom', 1285 - 'javelin-vector', 1286 - 'javelin-dom', 1287 - 'javelin-uri', 1288 - 'javelin-behavior-device', 1289 - 'phabricator-title', 1290 - ), 1291 1281 '724b1247' => array( 1292 1282 'javelin-behavior', 1293 1283 'javelin-typeahead-ondemand-source', ··· 1887 1877 'javelin-reactornode', 1888 1878 'javelin-util', 1889 1879 'javelin-reactor', 1880 + ), 1881 + 'f6bc26f0' => array( 1882 + 'javelin-behavior', 1883 + 'javelin-request', 1884 + 'javelin-stratcom', 1885 + 'javelin-vector', 1886 + 'javelin-dom', 1887 + 'javelin-uri', 1888 + 'javelin-behavior-device', 1889 + 'phabricator-title', 1890 1890 ), 1891 1891 'f726d506' => array( 1892 1892 'javelin-behavior',
+21 -13
webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
··· 63 63 request.send(); 64 64 } 65 65 66 + function set_visible(menu, icon) { 67 + if (menu) { 68 + statics.visible = {menu: menu, icon: icon}; 69 + if (icon) { 70 + JX.DOM.alterClass(icon, 'white', true); 71 + } 72 + } else { 73 + if (statics.visible) { 74 + JX.DOM.hide(statics.visible.menu); 75 + if (statics.visible.icon) { 76 + JX.DOM.alterClass(statics.visible.icon, 'white', false); 77 + } 78 + } 79 + statics.visible = null; 80 + } 81 + } 82 + 66 83 JX.Stratcom.listen( 67 84 'click', 68 85 null, 69 86 function(e) { 70 87 if (!e.getNode('phabricator-notification-menu')) { 71 88 // Click outside the dropdown; hide it. 72 - JX.DOM.hide(dropdown); 73 - if (icon) { 74 - JX.DOM.alterClass(icon, 'white', false); 75 - } 76 - statics.visible = null; 89 + set_visible(null); 77 90 return; 78 91 } 79 92 ··· 116 129 // If a menu is currently open, close it. 117 130 if (statics.visible) { 118 131 var previously_visible = statics.visible; 119 - JX.DOM.hide(statics.visible); 120 - statics.visible = null; 132 + set_visible(null); 121 133 122 134 // If the menu we just closed was the menu attached to the clicked 123 135 // icon, we're all done -- clicking the icon for an open menu just 124 136 // closes it. Otherwise, we closed some other menu and still need to 125 137 // open the one the user just clicked. 126 - if (previously_visible === dropdown) { 138 + if (previously_visible.menu === dropdown) { 127 139 return; 128 140 } 129 141 } ··· 143 155 } 144 156 p.setPos(dropdown); 145 157 146 - statics.visible = dropdown; 147 - 148 - if (icon) { 149 - JX.DOM.alterClass(icon, 'white', true); 150 - } 158 + set_visible(dropdown, icon); 151 159 } 152 160 ); 153 161