MCPcopy
hub / github.com/ampproject/amphtml / enterLightbox

Method enterLightbox

src/service/fixed-layer.js:114–128  ·  view source on GitHub ↗

* Informs FixedLayer that a lightbox was opened. * * - FixedLayer hides any transfer layer elements that may be overlaid on * top of the lightbox, which is confusing UX. * - When `onComplete` resolves, FixedLayer scans and transfers any fixed * descendants of `lightbox`. This enab

(opt_lightbox, opt_onComplete)

Source from the content-addressed store, hash-verified

112 * UX completes e.g. open transition animation.
113 */
114 enterLightbox(opt_lightbox, opt_onComplete) {
115 const transferLayer = this.getTransferLayer_();
116 if (transferLayer) {
117 transferLayer.setLightboxMode(true);
118 }
119
120 if (opt_lightbox && opt_onComplete) {
121 opt_onComplete.then(() =>
122 this.scanNode_(
123 dev().assertElement(opt_lightbox),
124 /* lightboxMode */ true
125 )
126 );
127 }
128 }
129
130 /**
131 * Reverses the actions performed by `enterLightbox()`.

Callers 1

enterLightboxModeMethod · 0.80

Calls 6

getTransferLayer_Method · 0.95
scanNode_Method · 0.95
devFunction · 0.90
assertElementMethod · 0.80
setLightboxModeMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected