Skip to content

Commit

Permalink
Fixes for lightbox gallery and shadow docs. (#20712)
Browse files Browse the repository at this point in the history
- Use AMP.win instead of global.
- Do the transition within the shadow doc, since that is where we are putting
  the styles for the transition.
  • Loading branch information
Sepand Parhami authored Feb 7, 2019
1 parent df0886a commit 09b9848
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/amp-lightbox-gallery/0.1/amp-lightbox-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ export class AmpLightboxGallery extends AMP.BaseElement {
// Prepare the actual image animation.
imageAnimation = prepareImageAnimation({
styleContainer: this.getAmpDoc().getHeadNode(),
transitionContainer: this.getAmpDoc().getBody(),
srcImg,
targetImg,
srcImgRect: undefined,
Expand Down Expand Up @@ -1479,5 +1480,5 @@ function lightboxManagerForDoc(element) {
AMP.extension(TAG, '0.1', AMP => {
AMP.registerElement(TAG, AmpLightboxGallery, CSS);
AMP.registerServiceForDoc('amp-lightbox-manager', LightboxManager);
Services.extensionsFor(global).addDocFactory(installLightboxGallery);
Services.extensionsFor(AMP.win).addDocFactory(installLightboxGallery);
});

0 comments on commit 09b9848

Please sign in to comment.