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

lose help cursor on blur

Summary:
Fixes T8501.
When losing focus while holding ctrl, we never get a key-up event; ctrl-f/d/tab make the browser tab lose focus.
So treat 'blur' (unfocus) as if the user released ctrl.

Test Plan: ctrl-f/ctrl-d/ctrl-tab, ctrl-click-outside-of-window, and move mouse over the content - see no help suggestions.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Maniphest Tasks: T8501

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

authored by

Aviv Eyal and committed by
epriestley
960a574d 55b44f53

+35 -17
+9 -9
resources/celerity/map.php
··· 11 11 'core.pkg.js' => 'a590b451', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', 14 - 'differential.pkg.js' => 'ebef29b1', 14 + 'differential.pkg.js' => 'fd95c208', 15 15 'diffusion.pkg.css' => '385e85b3', 16 16 'diffusion.pkg.js' => '0115b37c', 17 17 'maniphest.pkg.css' => '4845691a', ··· 407 407 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', 408 408 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8', 409 409 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f', 410 - 'rsrc/js/application/repository/repository-crossreference.js' => 'bea81850', 410 + 'rsrc/js/application/repository/repository-crossreference.js' => 'e9eeb416', 411 411 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 412 412 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 413 413 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6', ··· 643 643 'javelin-behavior-remarkup-preview' => 'f7379f45', 644 644 'javelin-behavior-reorder-applications' => '76b9fc3e', 645 645 'javelin-behavior-reorder-columns' => 'e1d25dfb', 646 - 'javelin-behavior-repository-crossreference' => 'bea81850', 646 + 'javelin-behavior-repository-crossreference' => 'e9eeb416', 647 647 'javelin-behavior-scrollbar' => '834a1173', 648 648 'javelin-behavior-search-reorder-queries' => 'e9581f08', 649 649 'javelin-behavior-select-on-click' => '4e3e79a6', ··· 1745 1745 'javelin-util', 1746 1746 'phabricator-shaped-request', 1747 1747 ), 1748 - 'bea81850' => array( 1749 - 'javelin-behavior', 1750 - 'javelin-dom', 1751 - 'javelin-stratcom', 1752 - 'javelin-uri', 1753 - ), 1754 1748 'c1700f6f' => array( 1755 1749 'javelin-install', 1756 1750 'javelin-util', ··· 1912 1906 'javelin-workflow', 1913 1907 'javelin-dom', 1914 1908 'phabricator-draggable-list', 1909 + ), 1910 + 'e9eeb416' => array( 1911 + 'javelin-behavior', 1912 + 'javelin-dom', 1913 + 'javelin-stratcom', 1914 + 'javelin-uri', 1915 1915 ), 1916 1916 'ea681761' => array( 1917 1917 'javelin-behavior',
+26 -8
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 40 40 'tag:span', 41 41 function(e) { 42 42 if (e.getType() === 'mouseout') { 43 - highlighted && JX.DOM.alterClass(highlighted, classHighlight, false); 44 - highlighted = null; 43 + unhighlight(); 45 44 return; 46 45 } 47 46 if (!isSignalkey(e)) { ··· 62 61 openSearch(highlighted, lang); 63 62 } 64 63 }); 64 + } 65 + function unhighlight() { 66 + highlighted && JX.DOM.alterClass(highlighted, classHighlight, false); 67 + highlighted = null; 65 68 } 66 69 67 70 function openSearch(target, lang) { ··· 110 113 linkAll(e.getData().container); 111 114 }); 112 115 116 + 113 117 JX.Stratcom.listen( 114 118 ['keydown', 'keyup'], 115 119 null, ··· 117 121 if (e.getRawEvent().keyCode !== signalKey) { 118 122 return; 119 123 } 120 - statics.active = (e.getType() === 'keydown'); 121 - linked.forEach(function(element) { 122 - JX.DOM.alterClass(element, classMouseCursor, statics.active); 123 - }); 124 + setCursorMode(e.getType() === 'keydown'); 124 125 125 126 if (!statics.active) { 126 - highlighted && JX.DOM.alterClass(highlighted, classHighlight, false); 127 - highlighted = null; 127 + unhighlight(); 128 128 } 129 129 }); 130 + 131 + JX.Stratcom.listen( 132 + 'blur', 133 + null, 134 + function(e) { 135 + if (e.getTarget()) { 136 + return; 137 + } 138 + unhighlight(); 139 + setCursorMode(false); 140 + }); 141 + 142 + function setCursorMode(active) { 143 + statics.active = active; 144 + linked.forEach(function(element) { 145 + JX.DOM.alterClass(element, classMouseCursor, statics.active); 146 + }); 147 + } 130 148 });