Skip to content

Commit

Permalink
Fix progress bar width at fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Masashi Hirano committed Nov 18, 2017
1 parent e5b1824 commit e65618a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion demo/slideshow.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions lib/SlideShow.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ var SlideShow = function (_React$Component) {
}
var barWidth = parent.children[0].offsetWidth;
var progressWidth = e.clientX - e.currentTarget.getBoundingClientRect().left;
if (_this.state.isFullScreen) {
progressWidth -= parent.children[0].offsetLeft;
}
var clickPosition = Math.floor(progressWidth / barWidth * 100);
var nextIndex = 0;
for (var i = 0; i < _this.props.images.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-slideshow-ui",
"version": "1.0.1",
"version": "1.0.2",
"author": "Masashi Hirano (https://github.com/shisama)",
"license": "MIT",
"description": "React UI Component for slideshow like SlideShare or SpeakerDeck.",
Expand Down
3 changes: 0 additions & 3 deletions src/SlideShow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ export default class SlideShow extends React.Component<Props, State> {
const barWidth = parent.children[0].offsetWidth;
let progressWidth =
e.clientX - e.currentTarget.getBoundingClientRect().left;
if (this.state.isFullScreen) {
progressWidth -= parent.children[0].offsetLeft;
}
const clickPosition = Math.floor(progressWidth / barWidth * 100);
let nextIndex = 0;
for (let i = 0; i < this.props.images.length; i++) {
Expand Down

0 comments on commit e65618a

Please sign in to comment.