a few updates
This commit is contained in:
parent
002fda6a6b
commit
f0dd789e86
@ -109,8 +109,6 @@ class this.Attentive
|
||||
@_slidesViewer ||= document.querySelector(@identifier)
|
||||
|
||||
start: ->
|
||||
@bodyClassList().add('loading')
|
||||
|
||||
if !this.isFile()
|
||||
window.addEventListener('popstate', @handlePopState, false)
|
||||
|
||||
@ -118,7 +116,20 @@ class this.Attentive
|
||||
document.addEventListener('keydown', @handleKeyDown, false)
|
||||
window.addEventListener('resize', _.throttle(@calculate, 500), false)
|
||||
|
||||
this.advanceTo(this.slideFromLocation())
|
||||
imageWait = null
|
||||
imageWait = =>
|
||||
wait = false
|
||||
|
||||
for slide in @allSlides()
|
||||
for img in slide.dom.getElementsByTagName('img')
|
||||
wait = true if !img.complete
|
||||
|
||||
if wait
|
||||
setTimeout(imageWait, 100)
|
||||
else
|
||||
this.advanceTo(this.slideFromLocation())
|
||||
|
||||
imageWait()
|
||||
|
||||
slideFromLocation: ->
|
||||
value = if this.isFile()
|
||||
@ -197,4 +208,5 @@ class this.Attentive
|
||||
@bodyClassList().remove('loading')
|
||||
|
||||
@initialRender = false
|
||||
|
||||
@currentWindowHeight = null
|
||||
this.calculate()
|
||||
|
@ -33,8 +33,8 @@ body, html {
|
||||
}
|
||||
|
||||
body.loading {
|
||||
#slides-container {
|
||||
opacity: 0;
|
||||
.slide {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,6 @@
|
||||
%link{:rel => 'stylesheet', :href => 'assets/application.css', :type => 'text/css'}/
|
||||
%style{:type => 'text/css'}= Pygments.css
|
||||
= haml :"_header"
|
||||
%body
|
||||
%body.loading
|
||||
= yield
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user