Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move selectors to buildCallback.
  • Loading branch information
processprocess committed Jan 31, 2022
commit f9f9ba25470a07a9d086c15687622e46834acd13
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ export class AmpStoryShoppingAttachment extends AMP.BaseElement {
/** @private {?Element} */
this.attachmentEl_ = null;

/** @private {!Element} */
this.pageEl_ = this.element.closest('amp-story-page');
/** @private {?Element} */
this.pageEl_ = null;

/** @private {!Array<!Element>} */
this.shoppingTags_ = Array.from(
this.pageEl_.querySelectorAll('amp-story-shopping-tag')
);
/** @private {?Array<!Element>} */
this.shoppingTags_ = null;

/** @private @const {!Element} */
this.plpContainer_ = <div></div>;
Expand All @@ -53,6 +51,10 @@ export class AmpStoryShoppingAttachment extends AMP.BaseElement {

/** @override */
buildCallback() {
this.pageEl_ = this.element.closest('amp-story-page');
this.shoppingTags_ = Array.from(
this.pageEl_.querySelectorAll('amp-story-shopping-tag')
);
if (this.shoppingTags_.length === 0) {
Comment thread
processprocess marked this conversation as resolved.
return;
}
Expand Down