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

Make lightbox close when the background is clicked

Summary: When you click the dark background, close the lightbox.

Test Plan: Clicked arrows, image, etc., to make sure it didn't close. Clicked background to close.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

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

+21 -2
+1 -1
src/__celerity_resource_map__.php
··· 1385 1385 ), 1386 1386 'javelin-behavior-lightbox-attachments' => 1387 1387 array( 1388 - 'uri' => '/res/6ddb05f8/rsrc/js/application/core/behavior-lightbox-attachments.js', 1388 + 'uri' => '/res/dfc1743a/rsrc/js/application/core/behavior-lightbox-attachments.js', 1389 1389 'type' => 'js', 1390 1390 'requires' => 1391 1391 array(
+20 -1
webroot/rsrc/js/application/core/behavior-lightbox-attachments.js
··· 81 81 82 82 lightbox = JX.$N('div', 83 83 { 84 - className : 'lightbox-attachment' 84 + className : 'lightbox-attachment', 85 + sigil: 'lightbox-attachment' 85 86 }, 86 87 img 87 88 ); ··· 282 283 null, 283 284 lightBoxHandleKeyDown 284 285 ); 286 + 287 + 288 + // When the user clicks the background, close the lightbox. 289 + JX.Stratcom.listen( 290 + 'click', 291 + 'lightbox-attachment', 292 + function (e) { 293 + if (!lightbox) { 294 + return; 295 + } 296 + if (e.getTarget() != e.getNode('lightbox-attachment')) { 297 + // Don't close if they clicked some other element, like the image 298 + // itself or the next/previous arrows. 299 + return; 300 + } 301 + closeLightBox(e); 302 + e.kill(); 303 + }); 285 304 286 305 });