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

Fix image prev/next cycling in lightboxes

Summary:
See <https://discourse.phabricator-community.org/t/lightbox-not-working/1201/3>. The lightbox code is fragile and currently relies on simulating a click on the actual "<a />" tag surrounding other images in the document.

This breaks the prev/next links which ignore the event because it there's no "<img />".

Instead, don't simulate clicks and just call the code we want directly.

Test Plan: Added several images to a page, used lightbox prev/next buttons to cycle between them.

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

+18 -14
+12 -12
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => 'e68cf1fa', 11 11 'conpherence.pkg.js' => '15191c65', 12 12 'core.pkg.css' => 'c218ed53', 13 - 'core.pkg.js' => '32bb68e9', 13 + 'core.pkg.js' => '8b7400e7', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '113e692c', 16 16 'differential.pkg.js' => 'f6d809c0', ··· 494 494 'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', 495 495 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 496 496 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', 497 - 'rsrc/js/core/behavior-lightbox-attachments.js' => '562bcce0', 497 + 'rsrc/js/core/behavior-lightbox-attachments.js' => '6b31879a', 498 498 'rsrc/js/core/behavior-line-linker.js' => 'a9b946f8', 499 499 'rsrc/js/core/behavior-more.js' => 'a80d0378', 500 500 'rsrc/js/core/behavior-object-selector.js' => '77c1f0b0', ··· 644 644 'javelin-behavior-history-install' => '7ee2b591', 645 645 'javelin-behavior-icon-composer' => '8499b6ab', 646 646 'javelin-behavior-launch-icon-composer' => '48086888', 647 - 'javelin-behavior-lightbox-attachments' => '562bcce0', 647 + 'javelin-behavior-lightbox-attachments' => '6b31879a', 648 648 'javelin-behavior-line-chart' => 'e4232876', 649 649 'javelin-behavior-load-blame' => '42126667', 650 650 'javelin-behavior-maniphest-batch-selector' => 'ad54037e', ··· 1362 1362 'javelin-vector', 1363 1363 'javelin-dom', 1364 1364 ), 1365 - '562bcce0' => array( 1366 - 'javelin-behavior', 1367 - 'javelin-stratcom', 1368 - 'javelin-dom', 1369 - 'javelin-mask', 1370 - 'javelin-util', 1371 - 'phuix-icon-view', 1372 - 'phabricator-busy', 1373 - ), 1374 1365 '58dea2fa' => array( 1375 1366 'javelin-install', 1376 1367 'javelin-util', ··· 1462 1453 ), 1463 1454 '69adf288' => array( 1464 1455 'javelin-install', 1456 + ), 1457 + '6b31879a' => array( 1458 + 'javelin-behavior', 1459 + 'javelin-stratcom', 1460 + 'javelin-dom', 1461 + 'javelin-mask', 1462 + 'javelin-util', 1463 + 'phuix-icon-view', 1464 + 'phabricator-busy', 1465 1465 ), 1466 1466 '6b8ef10b' => array( 1467 1467 'javelin-install',
+6 -2
webroot/rsrc/js/core/behavior-lightbox-attachments.js
··· 56 56 57 57 e.kill(); 58 58 59 + activateLightbox(e.getNode('lightboxable')); 60 + } 61 + 62 + function activateLightbox(target) { 59 63 var mainFrame = JX.$('main-page-frame'); 60 64 var links = JX.DOM.scry(mainFrame, '*', 'lightboxable'); 61 65 var phids = {}; ··· 68 72 // Now that we have the big picture phid situation sorted out, figure 69 73 // out how the actual node the user clicks fits into that big picture 70 74 // and build some pretty UI to show the attachment. 71 - var target = e.getNode('lightboxable'); 72 75 var target_data = JX.Stratcom.getData(target); 73 76 var total = JX.keys(phids).length; 74 77 var current = 1; ··· 324 327 } 325 328 e.prevent(); 326 329 closeLightBox(e); 327 - el.click(); 330 + 331 + activateLightbox(el); 328 332 } 329 333 330 334 // Only look for lightboxable inside the main page, not other lightboxes.