From 8025bc6432e28c3af014ff9ecf1dfeb0b37f3a1e Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 24 Dec 2015 12:33:13 -0800 Subject: [PATCH] Keep hovercards on screen a little harder Summary: Ref T8980. This calculation was not quite right and you could sneak one off screen if you tried carefully. Test Plan: Couldn't sneak one off screen anymore. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8980 Differential Revision: https://secure.phabricator.com/D14880 --- resources/celerity/map.php | 20 +++++++++---------- .../ManiphestTaskDetailController.php | 5 +++-- webroot/rsrc/js/core/Hovercard.js | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 5738ba6f6c..dfb0b520c4 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' => '3c8757c8', + 'core.pkg.js' => '2a50ac55', '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' => 'cb696bed', + 'rsrc/js/core/Hovercard.js' => '88e3466d', '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' => 'cb696bed', + 'phabricator-hovercard' => '88e3466d', 'phabricator-hovercard-view-css' => '1239cd52', 'phabricator-keyboard-shortcut' => '1ae869f2', 'phabricator-keyboard-shortcut-manager' => 'c1700f6f', @@ -1461,6 +1461,13 @@ return array( 'javelin-stratcom', 'javelin-dom', ), + '88e3466d' => array( + 'javelin-install', + 'javelin-dom', + 'javelin-vector', + 'javelin-request', + 'javelin-uri', + ), '88f0c5b3' => array( 'javelin-behavior', 'javelin-dom', @@ -1812,13 +1819,6 @@ return array( 'javelin-stratcom', 'phabricator-phtize', ), - 'cb696bed' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-vector', - 'javelin-request', - 'javelin-uri', - ), 'ccf1cbf8' => array( 'javelin-install', 'javelin-dom', diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index b2b49b43d4..6ca5ab2946 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -265,7 +265,8 @@ final class ManiphestTaskDetailController extends ManiphestController { ->execute(); foreach ($commit_phids as $phid) { - $revisions_commits[$phid] = $handles->renderHandle($phid); + $revisions_commits[$phid] = $handles->renderHandle($phid) + ->setShowHovercard(true); $revision_phid = key($drev_edges[$phid][$commit_drev]); $revision_handle = $handles->getHandleIfExists($revision_phid); if ($revision_handle) { @@ -273,7 +274,7 @@ final class ManiphestTaskDetailController extends ManiphestController { unset($edges[$task_drev][$revision_phid]); $revisions_commits[$phid] = hsprintf( '%s / %s', - $revision_handle->renderLink($revision_handle->getName()), + $revision_handle->renderHovercardLink($revision_handle->getName()), $revisions_commits[$phid]); } } diff --git a/webroot/rsrc/js/core/Hovercard.js b/webroot/rsrc/js/core/Hovercard.js index 5f5d986b3d..27c41fa037 100644 --- a/webroot/rsrc/js/core/Hovercard.js +++ b/webroot/rsrc/js/core/Hovercard.js @@ -109,7 +109,7 @@ JX.install('Hovercard', { // If the card is near the top of the window, show it beneath the // link we're hovering over instead. - if ((y + margin) < s.y) { + if ((y - margin) < s.y) { y = p.y + d.y + margin; self._alignment = 'south'; }