Skip to content

Commit

Permalink
Merge pull request #1810 from LendsMan/patch-1
Browse files Browse the repository at this point in the history
Some premature optimization for amp-slides
  • Loading branch information
jridgewell committed Feb 6, 2016
2 parents 17b32e3 + 7d823fa commit 824c1d9
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions extensions/amp-slides/0.1/amp-slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,35 @@ class AmpSlides extends AMP.BaseElement {

this.prevButton_ = document.createElement('button');
this.prevButton_.textContent = '\u276E';
this.prevButton_.style.opacity = 0.6;
this.prevButton_.style.position = 'absolute';
this.prevButton_.style.zIndex = 10;
this.prevButton_.style.left = '16px';
this.prevButton_.style.top = '50%';
this.prevButton_.style.padding = '8px';
this.prevButton_.style.fontSize = '24px';
this.prevButton_.style.marginTop = '-20px';
this.prevButton_.style.pointerEvents = 'all';
st.setStyles(this.prevButton_, {
opacity: 0.6,
position: 'absolute',
zIndex: 10,
left: '16px',
top: '50%',
padding: '8px',
fontSize: '24px',
marginTop: '-20px',
pointerEvents: 'all'
});
this.prevButton_.onclick = () => {
this.go(-1, true);
};
this.element.appendChild(this.prevButton_);

this.nextButton_ = document.createElement('button');
this.nextButton_.textContent = '\u276F';
this.nextButton_.style.opacity = 0.6;
this.nextButton_.style.position = 'absolute';
this.nextButton_.style.zIndex = 10;
this.nextButton_.style.right = '16px';
this.nextButton_.style.top = '50%';
this.nextButton_.style.padding = '8px';
this.nextButton_.style.fontSize = '24px';
this.nextButton_.style.marginTop = '-20px';
this.nextButton_.style.pointerEvents = 'all';
st.setStyles(this.nextButton_, {
opacity: 0.6,
position: 'absolute',
zIndex: 10,
right: '16px',
top: '50%',
padding: '8px',
fontSize: '24px',
marginTop: '-20px',
pointerEvents: 'all'
});
this.nextButton_.onclick = () => {
this.go(1, true);
};
Expand Down

0 comments on commit 824c1d9

Please sign in to comment.