Skip to content

Commit

Permalink
Trim page attachment cta text. (#26540)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmajoulet committed Jan 29, 2020
1 parent f3e4397 commit b2ddcfd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extensions/amp-story/1.0/amp-story-page.js
Expand Up @@ -1635,14 +1635,15 @@ export class AmpStoryPage extends AMP.BaseElement {
'.i-amphtml-story-page-open-attachment-label'
);

const openAttachmentLabel =
attachmentEl.getAttribute('data-cta-text') ||
const openLabelAttr = attachmentEl.getAttribute('data-cta-text');
const openLabel =
(openLabelAttr && openLabelAttr.trim()) ||
Services.localizationService(this.win).getLocalizedString(
LocalizedStringId.AMP_STORY_PAGE_ATTACHMENT_OPEN_LABEL
);

this.mutateElement(() => {
textEl.textContent = openAttachmentLabel;
textEl.textContent = openLabel;
this.element.appendChild(this.openAttachmentEl_);
});
}
Expand Down

0 comments on commit b2ddcfd

Please sign in to comment.