Skip to content

Commit

Permalink
Additional fixes for Set usage
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferbaxter committed May 6, 2021
1 parent 39006bd commit 0d4eb49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-lightbox-gallery/0.1/amp-lightbox-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export class AmpLightboxGallery extends AMP.BaseElement {
element: dev().assertElement(clonedNode),
};
let slide = clonedNode;
if (ELIGIBLE_TAP_TAGS[clonedNode.tagName]) {
if (ELIGIBLE_TAP_TAGS.has(clonedNode.tagName)) {
const container = this.doc_.createElement('div');
const imageViewer = htmlFor(this.doc_)`
<amp-image-viewer layout="fill"></amp-image-viewer>`;
Expand Down Expand Up @@ -808,7 +808,7 @@ export class AmpLightboxGallery extends AMP.BaseElement {
if (!element || !isLoaded(element)) {
return false;
}
if (!ELIGIBLE_TAP_TAGS[element.tagName]) {
if (!ELIGIBLE_TAP_TAGS.has(element.tagName)) {
return false;
}
const img = elementByTag(dev().assertElement(element), 'img');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ import {map} from '../../../../src/core/types/object';
import {srcsetFromElement, srcsetFromSrc} from '../../../../src/srcset';
import {toArray} from '../../../../src/core/types/array';

const LIGHTBOX_ELIGIBLE_TAGS = new Set(['AMP-IMG']);
const LIGHTBOX_ELGIBLE_NATIVE_ELEMENTS = new Set(['IMG']);
const LIGHTBOX_ELIGIBLE_TAGS = new Set(['AMP-IMG', 'IMG']);

// eslint-disable-next-line local/no-export-side-effect
export const ELIGIBLE_TAP_TAGS = new Set(['AMP-IMG']);
Expand Down Expand Up @@ -175,10 +174,7 @@ export class LightboxManager {
* @private
*/
baseElementIsSupported_(element) {
return (
LIGHTBOX_ELIGIBLE_TAGS.has(element.tagName) ||
LIGHTBOX_ELGIBLE_NATIVE_ELEMENTS.has(element.tagName)
);
return LIGHTBOX_ELIGIBLE_TAGS.has(element.tagName);
}

/**
Expand Down

0 comments on commit 0d4eb49

Please sign in to comment.