Skip to content

Commit

Permalink
Noticed these changes while refactoring on another branch (#34250)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferbaxter authored May 6, 2021
1 parent e84936c commit 30d62af
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions extensions/amp-story-auto-ads/0.1/amp-story-auto-ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {getServicePromiseForDoc} from '../../../src/service';
import {CSS as progessBarCSS} from '../../../build/amp-story-auto-ads-progress-bar-0.1.css';
import {setStyle} from '../../../src/style';
import {CSS as sharedCSS} from '../../../build/amp-story-auto-ads-shared-0.1.css';
import {toggleAttribute} from '../../../src/dom';

/** @const {string} */
const TAG = 'amp-story-auto-ads';
Expand Down Expand Up @@ -313,13 +314,11 @@ export class AmpStoryAutoAds extends AMP.BaseElement {
const {DESKTOP_PANELS} = Attributes;
this.adBadgeContainer_.removeAttribute(DESKTOP_PANELS);
// TODO(#33969) can no longer be null when launched.
this.progressBarBackground_ &&
this.progressBarBackground_.removeAttribute(DESKTOP_PANELS);
this.progressBarBackground_?.removeAttribute(DESKTOP_PANELS);

if (uiState === UIType.DESKTOP_PANELS) {
this.adBadgeContainer_.setAttribute(DESKTOP_PANELS, '');
this.progressBarBackground_ &&
this.progressBarBackground_.setAttribute(DESKTOP_PANELS, '');
this.progressBarBackground_?.setAttribute(DESKTOP_PANELS, '');
}
});
}
Expand Down Expand Up @@ -395,9 +394,7 @@ export class AmpStoryAutoAds extends AMP.BaseElement {
return;
}

isPaused
? this.progressBarBackground_.setAttribute(Attributes.PAUSED, '')
: this.progressBarBackground_.removeAttribute(Attributes.PAUSED);
toggleAttribute(this.progressBarBackground_, Attributes.PAUSED, isPaused);
}

/**
Expand Down

0 comments on commit 30d62af

Please sign in to comment.