Skip to content

Commit

Permalink
fixed navbar on form open
Browse files Browse the repository at this point in the history
  • Loading branch information
ding-ma committed Aug 29, 2020
1 parent 0fdd348 commit 637143e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
23 changes: 12 additions & 11 deletions public/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ window.onscroll = function () {
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
var header = document.querySelector('nav');

scrollY <= this.lastScroll
? header.style.visibility = 'visible'
: header.style.visibility = 'hidden';

if (scrollY <= this.lastScroll) {
header.style.visibility = 'visible'
} else {
header.style.visibility = 'hidden'
header.style.display = ""
}
this.lastScroll = scrollY;
}

Expand All @@ -17,10 +19,9 @@ $(function () {
});
});

//doesnt work to hide navbar with modal
// $(document).ready(function () {
// $("button").click(function () {
// console.log("123");
// $('.navbar-collapse').collapse('hide');
// });
// });
$(document).ready(function () {
$("#contact").click(function () {
// document.querySelector('nav').style.visibility = 'hidden';
$("nav").hide();
});
});
5 changes: 3 additions & 2 deletions src/Components/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class About extends Component<IProps, IState> {
</Button>
</div>
<div className="col-4">
<Button variant="secondary" className="button" onClick={this.openOnModal}>
<Button variant="secondary" className="button" onClick={this.openOnModal}
id={"contact"}>
<FormattedMessage id={"About.button.contact"}/></Button>
</div>
</div>
Expand All @@ -156,7 +157,7 @@ class About extends Component<IProps, IState> {
</div>
</div>
<Modal closeOnEsc={true} open={this.state.isFormOpen} onClose={this.onCloseModal}
showCloseIcon={false}
showCloseIcon={true}
closeOnOverlayClick={true} center={true}>
{renderForm()}
</Modal>
Expand Down

0 comments on commit 637143e

Please sign in to comment.