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

Look into issue where image with load:visible isn't appearing on load always #6

Closed
brokenhd opened this issue Dec 1, 2016 · 2 comments
Labels

Comments

@brokenhd
Copy link
Member

brokenhd commented Dec 1, 2016

We suspect it's webpack dev server shenangins. Add a window on load listener perhaps ... and maybe a clunky timeout.

@weotch weotch added the bug label Dec 1, 2016
@weotch
Copy link
Member

weotch commented Dec 2, 2016

Test if Document.readyState is loading. If so, addEventListener('DOMContentLoaded') and update the inViewport settings.

See:

@weotch
Copy link
Member

weotch commented Dec 2, 2016

Here's what I did on Coachella for fitText, do something similar

	mounted: ->
		@fitTagline()
		if document.readyState == 'loading'
			document.addEventListener 'readystatechange', handler = =>
				@fitTagline()
				if document.readyState == 'complete'
					document.removeEventListener 'readystatechange', handler

	# Setup fittext on the tagline
	methods: fitTagline: -> fitText @$refs.tagline, 4.2

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

No branches or pull requests

2 participants