@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.

Hide dropdown menus when users click workflow items

Summary:
In D16157, dropdown menus got an overly-broad check for not closing when an item is clicked.

Specifically, we don't want to close the menu if the item is really opening a submenu, like "Edit Related Objects..." does on mobile.

The check for this is too broad, and also doesn't close the menu if the item has workflow.

Instead, use a narrower check.

Test Plan:
- Menu still stays open when toggling submenus like "Edit Related Objects".
- Menu now closes properly when using workflow items like "Edit Comment" or "Remove Comment".

Reviewers: chad

Reviewed By: chad

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

+29 -22
+9 -9
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => '0b64e988', 11 11 'conpherence.pkg.js' => '6249a1cf', 12 12 'core.pkg.css' => '1afa1d13', 13 - 'core.pkg.js' => 'a2ead3fe', 13 + 'core.pkg.js' => '892976d4', 14 14 'darkconsole.pkg.js' => 'e7393ebb', 15 15 'differential.pkg.css' => '9535a7e6', 16 16 'differential.pkg.js' => 'ddfeb49b', ··· 533 533 'rsrc/js/core/behavior-watch-anchor.js' => '9f36c42d', 534 534 'rsrc/js/core/behavior-workflow.js' => '0a3f3021', 535 535 'rsrc/js/core/phtize.js' => 'd254d646', 536 - 'rsrc/js/phui/behavior-phui-dropdown-menu.js' => '1aa4c968', 536 + 'rsrc/js/phui/behavior-phui-dropdown-menu.js' => '8744dfd1', 537 537 'rsrc/js/phui/behavior-phui-file-upload.js' => 'b003d4fb', 538 538 'rsrc/js/phui/behavior-phui-submenu.js' => 'a6f7a73b', 539 539 'rsrc/js/phui/behavior-phui-tab-group.js' => '0a0b10e9', ··· 686 686 'javelin-behavior-phabricator-watch-anchor' => '9f36c42d', 687 687 'javelin-behavior-pholio-mock-edit' => 'bee502c8', 688 688 'javelin-behavior-pholio-mock-view' => 'fbe497e7', 689 - 'javelin-behavior-phui-dropdown-menu' => '1aa4c968', 689 + 'javelin-behavior-phui-dropdown-menu' => '8744dfd1', 690 690 'javelin-behavior-phui-file-upload' => 'b003d4fb', 691 691 'javelin-behavior-phui-hovercards' => 'bcaccd64', 692 692 'javelin-behavior-phui-submenu' => 'a6f7a73b', ··· 1057 1057 '19f9369b' => array( 1058 1058 'phui-oi-list-view-css', 1059 1059 ), 1060 - '1aa4c968' => array( 1061 - 'javelin-behavior', 1062 - 'javelin-stratcom', 1063 - 'javelin-dom', 1064 - 'phuix-dropdown-menu', 1065 - ), 1066 1060 '1ad0a787' => array( 1067 1061 'javelin-install', 1068 1062 'javelin-reactor', ··· 1572 1566 'javelin-stratcom', 1573 1567 'phabricator-tooltip', 1574 1568 'changeset-view-manager', 1569 + ), 1570 + '8744dfd1' => array( 1571 + 'javelin-behavior', 1572 + 'javelin-stratcom', 1573 + 'javelin-dom', 1574 + 'phuix-dropdown-menu', 1575 1575 ), 1576 1576 '88236f00' => array( 1577 1577 'javelin-behavior',
+17 -12
src/view/layout/PhabricatorActionView.php
··· 173 173 ->setIcon($this->icon.$color); 174 174 } 175 175 176 - if ($this->href) { 176 + $sigils = array(); 177 + if ($this->workflow) { 178 + $sigils[] = 'workflow'; 179 + } 177 180 178 - $sigils = array(); 179 - if ($this->workflow) { 180 - $sigils[] = 'workflow'; 181 - } 182 - if ($this->download) { 183 - $sigils[] = 'download'; 184 - } 181 + if ($this->download) { 182 + $sigils[] = 'download'; 183 + } 185 184 186 - if ($this->sigils) { 187 - $sigils = array_merge($sigils, $this->sigils); 188 - } 185 + if ($this->submenu) { 186 + $sigils[] = 'keep-open'; 187 + } 189 188 190 - $sigils = $sigils ? implode(' ', $sigils) : null; 189 + if ($this->sigils) { 190 + $sigils = array_merge($sigils, $this->sigils); 191 + } 192 + 193 + $sigils = $sigils ? implode(' ', $sigils) : null; 191 194 195 + if ($this->href) { 192 196 if ($this->renderAsForm) { 193 197 if (!$this->hasViewer()) { 194 198 throw new Exception( ··· 248 252 'span', 249 253 array( 250 254 'class' => 'phabricator-action-view-item', 255 + 'sigil' => $sigils, 251 256 ), 252 257 array($icon, $this->name)); 253 258 }
+3 -1
webroot/rsrc/js/phui/behavior-phui-dropdown-menu.js
··· 48 48 return; 49 49 } 50 50 51 - if (JX.Stratcom.pass()) { 51 + // If this item opens a submenu, we don't want to close the current 52 + // menu. One submenu is "Edit Related Objects..." on mobile. 53 + if (JX.Stratcom.hasSigil(e.getTarget(), 'keep-open')) { 52 54 return; 53 55 } 54 56