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

Check for document.getElementById in main.js #40

Closed
BrookeDot opened this issue Oct 3, 2019 · 3 comments
Closed

Check for document.getElementById in main.js #40

BrookeDot opened this issue Oct 3, 2019 · 3 comments

Comments

@BrookeDot
Copy link
Contributor

BrookeDot commented Oct 3, 2019

I use a slightly modified index.html page which includes my custom CSS styles and text changes. With the most recent update I ran into an issue with the index template where #url was undefined causing a fatal JavaScript error.

I tracked this down to document.getElementById("url").textContent = url; in main.js
https://github.com/bilde2910/Hauk/blob/master/frontend/main.js#L215

To keep things simple and to not make changes to main.js I just set the color of the URL div to match the background color which works. I think I could also use visibility:hidden instead

Overall, I do like the new changes providing more information but wondering if we should wrap some of the getElementById statements in a if type !== undefined) checks. If so, which ones?

The main one the effects the layout I've found is #URL so that's why I'm specifically mentioning that one.

@BrookeDot
Copy link
Contributor Author

Default view:
Screen Shot 2019-10-02 at 5 54 37 PM

Showing the URL is still there but hidden:
Screen Shot 2019-10-02 at 5 57 04 PM

@bilde2910
Copy link
Owner

I can certainly implement this, as it's a pretty quick fix. Maybe it could be an idea to allow some kind of custom HTML setup, but right now I have no idea whatsoever on how to practically implement that.

@bilde2910
Copy link
Owner

Fixed in latest commit. Modifying the HTML isn't really officially supported, but at least you shouldn't get errors anymore when doing it

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants