diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 456a8a2b0a..dfc8e986a9 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => 'ca3f6a60', - 'core.pkg.js' => '5a18f0ab', + 'core.pkg.js' => 'dcd6c8e3', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => 'bb338e4b', 'differential.pkg.js' => '895b8d62', @@ -436,7 +436,7 @@ return array( 'rsrc/js/core/DragAndDropFileUpload.js' => '07de8873', 'rsrc/js/core/DraggableList.js' => 'a16ec1c6', 'rsrc/js/core/FileUpload.js' => '477359c8', - 'rsrc/js/core/Hovercard.js' => '7e8468ae', + 'rsrc/js/core/Hovercard.js' => '14ac66f5', 'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2', 'rsrc/js/core/KeyboardShortcutManager.js' => 'c1700f6f', 'rsrc/js/core/MultirowRowManager.js' => 'b5d57730', @@ -724,7 +724,7 @@ return array( 'phabricator-file-upload' => '477359c8', 'phabricator-filetree-view-css' => 'fccf9f82', 'phabricator-flag-css' => '5337623f', - 'phabricator-hovercard' => '7e8468ae', + 'phabricator-hovercard' => '14ac66f5', 'phabricator-hovercard-view-css' => '44394670', 'phabricator-keyboard-shortcut' => '1ae869f2', 'phabricator-keyboard-shortcut-manager' => 'c1700f6f', @@ -913,6 +913,13 @@ return array( 'javelin-json', 'phabricator-draggable-list', ), + '14ac66f5' => array( + 'javelin-install', + 'javelin-dom', + 'javelin-vector', + 'javelin-request', + 'javelin-uri', + ), '14d7a8b8' => array( 'javelin-behavior', 'javelin-behavior-device', @@ -1410,13 +1417,6 @@ return array( '7e41274a' => array( 'javelin-install', ), - '7e8468ae' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-vector', - 'javelin-request', - 'javelin-uri', - ), '7ebaeed3' => array( 'herald-rule-editor', 'javelin-behavior', diff --git a/webroot/rsrc/js/core/Hovercard.js b/webroot/rsrc/js/core/Hovercard.js index e83b0fcba0..15149eceeb 100644 --- a/webroot/rsrc/js/core/Hovercard.js +++ b/webroot/rsrc/js/core/Hovercard.js @@ -80,6 +80,7 @@ JX.install('Hovercard', { var p = JX.$V(root); var d = JX.Vector.getDim(root); var n = JX.Vector.getDim(child); + var v = JX.Vector.getViewport(); // Move the tip so it's nicely aligned. // I'm just doing north/south alignment for now @@ -89,8 +90,12 @@ JX.install('Hovercard', { var x = parseInt(p.x, 10) - margin / 2; var y = parseInt(p.y - n.y, 10) - margin; + // If running off the edge of the viewport, make it margin / 2 away + // from the far right edge of the viewport instead + if ((x + n.x) > (v.x)) { + x = x - parseInt(x + n.x - v.x + margin / 2, 10); // If more in the center, we can safely center - if (x > (n.x / 2) + margin) { + } else if (x > (n.x / 2) + margin) { x = parseInt(p.x - (n.x / 2) + d.x, 10); }