From e0ad791247f6cf58c20f63d3da632651ebb133c0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 24 Dec 2015 12:37:38 -0800 Subject: [PATCH] Fix hovercard behavior for multiple copies of the same object Summary: Ref T8980. Previously, if you had like `T123 T123 T123` and waved your mouse over them, we wouldn't move the card. Now, move the card. Test Plan: Waved mouse. Saw the card move. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8980 Differential Revision: https://secure.phabricator.com/D14881 --- resources/celerity/map.php | 20 +++++++++---------- .../field/PhabricatorCustomField.php | 2 +- webroot/rsrc/js/core/Hovercard.js | 5 +++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index dfb0b520c4..d09165b13a 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => 'a419cf4b', - 'core.pkg.js' => '2a50ac55', + 'core.pkg.js' => '400453e4', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', 'differential.pkg.js' => '64e69521', @@ -452,7 +452,7 @@ return array( 'rsrc/js/core/DragAndDropFileUpload.js' => 'ad10aeac', 'rsrc/js/core/DraggableList.js' => 'a16ec1c6', 'rsrc/js/core/FileUpload.js' => '477359c8', - 'rsrc/js/core/Hovercard.js' => '88e3466d', + 'rsrc/js/core/Hovercard.js' => 'c6f720ff', 'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2', 'rsrc/js/core/KeyboardShortcutManager.js' => 'c1700f6f', 'rsrc/js/core/MultirowRowManager.js' => 'b5d57730', @@ -747,7 +747,7 @@ return array( 'phabricator-file-upload' => '477359c8', 'phabricator-filetree-view-css' => 'fccf9f82', 'phabricator-flag-css' => '5337623f', - 'phabricator-hovercard' => '88e3466d', + 'phabricator-hovercard' => 'c6f720ff', 'phabricator-hovercard-view-css' => '1239cd52', 'phabricator-keyboard-shortcut' => '1ae869f2', 'phabricator-keyboard-shortcut-manager' => 'c1700f6f', @@ -1461,13 +1461,6 @@ return array( 'javelin-stratcom', 'javelin-dom', ), - '88e3466d' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-vector', - 'javelin-request', - 'javelin-uri', - ), '88f0c5b3' => array( 'javelin-behavior', 'javelin-dom', @@ -1780,6 +1773,13 @@ return array( 'javelin-dom', 'javelin-vector', ), + 'c6f720ff' => array( + 'javelin-install', + 'javelin-dom', + 'javelin-vector', + 'javelin-request', + 'javelin-uri', + ), 'c72aa091' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php index 6299cc047e..a89d8005f0 100644 --- a/src/infrastructure/customfield/field/PhabricatorCustomField.php +++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php @@ -506,7 +506,7 @@ abstract class PhabricatorCustomField extends Phobject { $out = array(); foreach ($handles as $handle) { - $out[] = $handle->renderLink(); + $out[] = $handle->renderHovercardLink(); } return phutil_implode_html(phutil_tag('br'), $out); diff --git a/webroot/rsrc/js/core/Hovercard.js b/webroot/rsrc/js/core/Hovercard.js index 27c41fa037..26774d4f25 100644 --- a/webroot/rsrc/js/core/Hovercard.js +++ b/webroot/rsrc/js/core/Hovercard.js @@ -39,10 +39,11 @@ JX.install('Hovercard', { show : function(root, phid) { var self = JX.Hovercard; - // Already displaying - if (self.getCard() && phid == self._visiblePHID) { + + if (root === this._activeRoot) { return; } + self.hide(); self._visiblePHID = phid;