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

Hovercards - don't let them run off the right edge of the viewport anymore

Summary: Fixes T7524.

Test Plan:
- made a task with a comment including another task. resized window so still desktop size and task reference on edge of window. invoked hovercard by bovering over task reference and noted the hovercard was completely visible.
- opened the durable column and made a task reference. invoked hovercard by hovering over task reference and noted the hovercard was completely visible.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7524

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

+16 -11
+10 -10
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => 'ca3f6a60', 11 - 'core.pkg.js' => '5a18f0ab', 11 + 'core.pkg.js' => 'dcd6c8e3', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'bb338e4b', 14 14 'differential.pkg.js' => '895b8d62', ··· 436 436 'rsrc/js/core/DragAndDropFileUpload.js' => '07de8873', 437 437 'rsrc/js/core/DraggableList.js' => 'a16ec1c6', 438 438 'rsrc/js/core/FileUpload.js' => '477359c8', 439 - 'rsrc/js/core/Hovercard.js' => '7e8468ae', 439 + 'rsrc/js/core/Hovercard.js' => '14ac66f5', 440 440 'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2', 441 441 'rsrc/js/core/KeyboardShortcutManager.js' => 'c1700f6f', 442 442 'rsrc/js/core/MultirowRowManager.js' => 'b5d57730', ··· 724 724 'phabricator-file-upload' => '477359c8', 725 725 'phabricator-filetree-view-css' => 'fccf9f82', 726 726 'phabricator-flag-css' => '5337623f', 727 - 'phabricator-hovercard' => '7e8468ae', 727 + 'phabricator-hovercard' => '14ac66f5', 728 728 'phabricator-hovercard-view-css' => '44394670', 729 729 'phabricator-keyboard-shortcut' => '1ae869f2', 730 730 'phabricator-keyboard-shortcut-manager' => 'c1700f6f', ··· 913 913 'javelin-json', 914 914 'phabricator-draggable-list', 915 915 ), 916 + '14ac66f5' => array( 917 + 'javelin-install', 918 + 'javelin-dom', 919 + 'javelin-vector', 920 + 'javelin-request', 921 + 'javelin-uri', 922 + ), 916 923 '14d7a8b8' => array( 917 924 'javelin-behavior', 918 925 'javelin-behavior-device', ··· 1409 1416 ), 1410 1417 '7e41274a' => array( 1411 1418 'javelin-install', 1412 - ), 1413 - '7e8468ae' => array( 1414 - 'javelin-install', 1415 - 'javelin-dom', 1416 - 'javelin-vector', 1417 - 'javelin-request', 1418 - 'javelin-uri', 1419 1419 ), 1420 1420 '7ebaeed3' => array( 1421 1421 'herald-rule-editor',
+6 -1
webroot/rsrc/js/core/Hovercard.js
··· 80 80 var p = JX.$V(root); 81 81 var d = JX.Vector.getDim(root); 82 82 var n = JX.Vector.getDim(child); 83 + var v = JX.Vector.getViewport(); 83 84 84 85 // Move the tip so it's nicely aligned. 85 86 // I'm just doing north/south alignment for now ··· 89 90 var x = parseInt(p.x, 10) - margin / 2; 90 91 var y = parseInt(p.y - n.y, 10) - margin; 91 92 93 + // If running off the edge of the viewport, make it margin / 2 away 94 + // from the far right edge of the viewport instead 95 + if ((x + n.x) > (v.x)) { 96 + x = x - parseInt(x + n.x - v.x + margin / 2, 10); 92 97 // If more in the center, we can safely center 93 - if (x > (n.x / 2) + margin) { 98 + } else if (x > (n.x / 2) + margin) { 94 99 x = parseInt(p.x - (n.x / 2) + d.x, 10); 95 100 } 96 101