Page MenuHomePhabricator

D12010.id28913.diff
No OneTemporary

D12010.id28913.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -11,7 +11,7 @@
'core.pkg.js' => '5a1c336d',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => 'df94a9e2',
- 'differential.pkg.js' => 'f458a7dc',
+ 'differential.pkg.js' => 'd900d95c',
'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => 'bfc0737b',
'maniphest.pkg.css' => '68d4dd3d',
@@ -367,7 +367,7 @@
'rsrc/js/application/differential/behavior-comment-preview.js' => '6932def3',
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb',
- 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '33d4c5e2',
+ 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '35141b5f',
'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492',
'rsrc/js/application/differential/behavior-populate.js' => '8694b1df',
'rsrc/js/application/differential/behavior-show-field-details.js' => 'bba9eedf',
@@ -569,7 +569,7 @@
'javelin-behavior-differential-comment-jump' => '4fdb476d',
'javelin-behavior-differential-diff-radios' => 'e1ff79b1',
'javelin-behavior-differential-dropdown-menus' => '2035b9cb',
- 'javelin-behavior-differential-edit-inline-comments' => '33d4c5e2',
+ 'javelin-behavior-differential-edit-inline-comments' => '35141b5f',
'javelin-behavior-differential-feedback-preview' => '6932def3',
'javelin-behavior-differential-keyboard-navigation' => '2c426492',
'javelin-behavior-differential-populate' => '8694b1df',
@@ -1027,7 +1027,7 @@
'331b1611' => array(
'javelin-install',
),
- '33d4c5e2' => array(
+ '35141b5f' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
diff --git a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
--- a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
+++ b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
@@ -128,20 +128,59 @@
});
JX.Stratcom.listen(
- 'mouseover',
+ ['mouseover', 'mouseout'],
['differential-changeset', 'tag:th'],
function(e) {
- if (!selecting ||
- editor ||
- (getRowNumber(e.getTarget()) === undefined) ||
- (isOnRight(e.getTarget()) != isOnRight(origin)) ||
- (e.getNode('differential-changeset') !== root)) {
+ if (editor) {
+ // Don't update the reticle if we're editing a comment, since this
+ // would be distracting and we want to keep the lines corresponding
+ // to the comment highlighted during the edit.
return;
}
- target = e.getTarget();
+ if (getRowNumber(e.getTarget()) === undefined) {
+ // Don't update the reticle if this "<th />" doesn't correspond to a
+ // line number. For instance, this may be a dead line number, like the
+ // empty line numbers on the left hand side of a newly added file.
+ return;
+ }
- updateReticle();
+ if (selecting) {
+ if (isOnRight(e.getTarget()) != isOnRight(origin)) {
+ // Don't update the reticle if we're selecting a line range and the
+ // "<th />" under the cursor is on the wrong side of the file. You
+ // can only leave inline comments on the left or right side of a
+ // file, not across lines on both sides.
+ return;
+ }
+
+ if (e.getNode('differential-changeset') !== root) {
+ // Don't update the reticle if we're selecting a line range and
+ // the "<th />" under the cursor corresponds to a different file.
+ // You can only leave inline comments on lines in a single file,
+ // not across multiple files.
+ return;
+ }
+ }
+
+ if (e.getType() == 'mouseout') {
+ if (selecting) {
+ // Don't hide the reticle if we're selecting, since we want to
+ // keep showing the line range that will be used if the mouse is
+ // released.
+ return;
+ }
+ hideReticle();
+ } else {
+ target = e.getTarget();
+ if (!selecting) {
+ // If we're just hovering the mouse and not selecting a line range,
+ // set the origin to the current row so we highlight it.
+ origin = target;
+ }
+
+ updateReticle();
+ }
});
JX.Stratcom.listen(

File Metadata

Mime Type
text/plain
Expires
Mar 5 2025, 10:33 AM (5 w, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225124
Default Alt Text
D12010.id28913.diff (4 KB)

Event Timeline