mirror of
https://github.com/flynx/PortableMag.git
synced 2025-11-01 20:40:20 +00:00
more work on scrolling...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
257414584b
commit
377803e777
31
layout.html
31
layout.html
@ -107,15 +107,40 @@ $(document).ready(function(){
|
|||||||
_log.scrollTop(_log.prop('scrollHeight'))
|
_log.scrollTop(_log.prop('scrollHeight'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var CHECK_INTERVAL = 200
|
||||||
|
var touching = false
|
||||||
|
var t
|
||||||
|
|
||||||
|
function wait_for_scroll_end(){
|
||||||
|
if(!touching){
|
||||||
|
// XXX need to avoid this being called more than once...
|
||||||
|
$('.viewer').trigger('scrollend')
|
||||||
|
t = null
|
||||||
|
} else {
|
||||||
|
t = setTimeout(wait_for_scroll_end, CHECK_INTERVAL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$('.viewer')
|
$('.viewer')
|
||||||
.on('scroll', function(evt){
|
.on('scroll', function(evt){
|
||||||
log('scroll...')
|
log('scroll...')
|
||||||
|
|
||||||
|
if(t == null){
|
||||||
|
t = setTimeout(wait_for_scroll_end, CHECK_INTERVAL)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.on('touchend', function(evt){
|
.on('touchstart mousedown', function(evt){
|
||||||
|
log('touchstart...')
|
||||||
|
|
||||||
|
touching = true
|
||||||
|
})
|
||||||
|
.on('touchend mouseup', function(evt){
|
||||||
log('touchend...')
|
log('touchend...')
|
||||||
|
|
||||||
|
touching = false
|
||||||
})
|
})
|
||||||
.on('mouseup', function(evt){
|
.on('scrollend', function(evt){
|
||||||
log('mouseup...')
|
log('!!! scrollend...')
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user