Skip to content

Commit

Permalink
Added presentation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
damonsk committed Dec 12, 2023
1 parent 47bfef8 commit 00e58d2
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/components/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,29 @@ function Editor(props) {
};
};

const getHeight = () => {
var winHeight = window.innerHeight;
var topNavHeight = document.getElementById('top-nav-wrapper').clientHeight;
var titleHeight = document.getElementById('title').clientHeight;
return winHeight - topNavHeight - titleHeight + 10;
};

const handleResize = () => {
setHeight(getHeight());
};

useEffect(() => {
handleResize();
const getHeight = () => {
var winHeight = window.innerHeight;
var topNavHeight = document.getElementById('top-nav-wrapper')
.clientHeight;
var titleHeight = document.getElementById('title').clientHeight;
return winHeight - topNavHeight - titleHeight + 10;
};
setHeight(getHeight());
}, [props.mapOnlyView]);

useEffect(() => {
const getHeight = () => {
var winHeight = window.innerHeight;
var topNavHeight = document.getElementById('top-nav-wrapper')
.clientHeight;
var titleHeight = document.getElementById('title').clientHeight;
return winHeight - topNavHeight - titleHeight + 10;
};
const handleResize = () => {
setHeight(getHeight());
};

window.addEventListener('load', handleResize);
window.addEventListener('resize', handleResize);
return function cleanup() {
Expand Down

0 comments on commit 00e58d2

Please sign in to comment.