Skip to content

Commit

Permalink
fix preview position on fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Masashi Hirano committed Aug 26, 2017
1 parent 2dfb43d commit aeb6a79
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
9 changes: 8 additions & 1 deletion demo/slideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,14 @@ var SlideShow = function (_React$Component) {
key: key
});
});
var fullscreenBottom = document.mozFullScreen ? 180 : 120;
var fullscreenBottom = 120;
var wrapper = document.querySelector('.slideshow-wrapper');
var content = document.querySelector('.content');
var progressBar = document.querySelector('.progressBar');
var bar = document.querySelector('.bar');
if (wrapper && content && progressBar && bar) {
fullscreenBottom = window.screen.availHeight - content.offsetHeight + progressBar.offsetHeight + bar.offsetHeight + 10;
}
var bottom = _this.state.isFullScreen ? fullscreenBottom : _Styles.Styles.PREVIEW.bottom;
var STYLE = _extends({}, _Styles.Styles.PREVIEW, {
opacity: _this.state.preview,
Expand Down
11 changes: 9 additions & 2 deletions lib/SlideShow.js

Large diffs are not rendered by default.

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": "0.3.4",
"version": "0.3.5",
"author": "Masashi Hirano (https://github.com/shisama)",
"license": "MIT",
"description": "React UI Component for slideshow like SlideShare or SpeakerDeck.",
Expand Down
14 changes: 13 additions & 1 deletion src/SlideShow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,19 @@ export default class SlideShow extends React.Component {
/>
);
});
const fullscreenBottom = document.mozFullScreen ? 180 : 120;
let fullscreenBottom = 120;
const wrapper = document.querySelector('.slideshow-wrapper');
const content = document.querySelector('.content');
const progressBar = document.querySelector('.progressBar');
const bar = document.querySelector('.bar');
if (wrapper && content && progressBar && bar) {
fullscreenBottom =
window.screen.availHeight -
content.offsetHeight +
progressBar.offsetHeight +
bar.offsetHeight +
10;
}
const bottom = this.state.isFullScreen
? fullscreenBottom
: styles.PREVIEW.bottom;
Expand Down

0 comments on commit aeb6a79

Please sign in to comment.