Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added param hide_menu which when set to true will hide the menu #42

Merged
merged 1 commit into from
Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,10 @@ body .gt-remove {
top: 7.5rem;
}
}
/* if user is hiding the menu, make the map take up the whole screen */
[hide_menu=true] #map {
left: 0;
}
[hide_menu=true] #menu {
display: none;
}
13 changes: 12 additions & 1 deletion public/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,15 @@ html, body {
}
}

}
}


/* if user is hiding the menu, make the map take up the whole screen */
[hide_menu=true] {
#map {
left: 0;
}
#menu {
display: none;
}
}
12 changes: 9 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
let React = require('react');
let ReactDOM = require('react-dom');
let MapContainer = require('./MapContainer');
let Menu = require('./Menu');

class App extends React.Component {

constructor(props) {
super(props);
var url_params = new URLSearchParams(window.location.search);
var hide_menu = ["", "true", "True", "y", "Y", "yes", "Yes"].indexOf(url_params.get("hide_menu")) > -1 || false;
this.state = {
params: new URLSearchParams(window.location.search)
hide_menu: hide_menu,
params: url_params
};
}

componentDidMount() {
console.log("App mounted");
var element = ReactDOM.findDOMNode(this.refs.main_app);
element.setAttribute("hide_menu", this.state.hide_menu);
}

render() {
return (
<div className="App">
<Menu params={this.state.params}/>
<div className="App" ref="main_app">
<Menu params={this.state.params}/>;
<MapContainer params={this.state.params}/>
</div>
);
Expand Down