Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Fixed JS error on the main page of the site #1013 #1031

Merged
merged 4 commits into from
Oct 31, 2020

Conversation

MSTEWARDSON
Copy link
Contributor

Fixed the undefined error that came up for the 'left' value of viewport on the main page. After looking through the code I determined the issue was caused within the function checkSideBar(). Here the html element 'main-head' was used to call the isOnScreen() function. The issue with this and why the error only happened on the homepage was because the homepage does not use the 'main-head' css class.

To fix this issue there is now a check to see if the 'main-head' element exists using .length.

Issue: JS error on the main page of the site #1013

@netlify
Copy link

netlify bot commented Oct 31, 2020

You can view the preview now!

Built with commit c75a851

https://deploy-preview-1031--clever-boyd-7dd108.netlify.app

Comment on lines 79 to 80


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@MSTEWARDSON
Copy link
Contributor Author

I have removed the extra space in the checkSidebar() function.

Copy link
Member

@glebkema glebkema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSTEWARDSON Thank you for the quick analysis and fixing the problem!
Could you make the same improvement to the footer code below in this same function?

@MSTEWARDSON
Copy link
Contributor Author

Sure I will work on that now.

@MSTEWARDSON
Copy link
Contributor Author

Alright I added the check to the footer section of the function now.

Copy link
Member

@glebkema glebkema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSTEWARDSON Super! Thank you very much. We will be glad if you can help us in other tasks.

@shahednasser I propose to merge this PR.

@shahednasser shahednasser linked an issue Oct 31, 2020 that may be closed by this pull request
@shahednasser shahednasser merged commit d953f67 into sButtons:master Oct 31, 2020
@shahednasser
Copy link
Collaborator

Awesome thanks for your work and detailed description!

@all-contributors please add @MSTEWARDSON for code and bug

@allcontributors
Copy link
Contributor

@shahednasser

I've put up a pull request to add @MSTEWARDSON! 🎉

@MSTEWARDSON
Copy link
Contributor Author

Perfect, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS error on the main page of the site
4 participants