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

Fix error when loading painting from URL #268

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

msub2
Copy link
Contributor

@msub2 msub2 commented Mar 4, 2022

Was getting an error while removing the hidden class from apainter-logo.
Wrapped the code block in a DOMContentLoaded listener to fix.
Also updated THREE.XHRLoader -> THREE.FileLoader

document.getElementById('acamera').setAttribute('orbit-controls', 'position', '0 1.6 3');
document.getElementById('apainter-logo').classList.remove('hidden');
//document.getElementById('apainter-author').classList.remove('hidden'); // not used yet
document.addEventListener('DOMContentLoaded', e => {
Copy link
Member

Choose a reason for hiding this comment

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

This is strange. This logic is in the init method. It shouldn't run before the DOM is ready. Maybe I'm not fully understanding

@msub2
Copy link
Contributor Author

msub2 commented Mar 8, 2022

I'll test it again later today, but it seemed to be consistently happening

@msub2
Copy link
Contributor Author

msub2 commented Mar 9, 2022

Took some timestamps and it is definitely running init code before DOMContentLoaded

Was getting an error while removing the hidden class from apainter-logo.
Wrapped the code block in a DOMContentLoaded listener to fix.
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

Successfully merging this pull request may close these issues.

None yet

2 participants