mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
basic scroll position is maintained, still buggy...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ad6cdac1da
commit
6289076a73
@ -4529,15 +4529,22 @@ var HTMLBrowserPrototype = {
|
|||||||
&& that.focused.elem.focus() })
|
&& that.focused.elem.focus() })
|
||||||
//*/
|
//*/
|
||||||
|
|
||||||
// XXX get the scroll offset...
|
|
||||||
// XXX
|
|
||||||
console.log('SCROLL OFFSET:', context.scroll_offset)
|
|
||||||
|
|
||||||
// XXX should this be done here or in .render(..)???
|
// XXX should this be done here or in .render(..)???
|
||||||
this.dom = d
|
this.dom = d
|
||||||
|
|
||||||
// set the scroll offset...
|
// set the scroll offset...
|
||||||
// XXX
|
if(context.root === this && context.scroll_offset){
|
||||||
|
console.log('SCROLL OFFSET:', context.scroll_offset)
|
||||||
|
|
||||||
|
var ref = this.focused || this.pagetop
|
||||||
|
// XXX for some reason this can be null...
|
||||||
|
// ...this seems to be the case for nested browsers...
|
||||||
|
var scrolled = ref.dom.offsetParent
|
||||||
|
|
||||||
|
scrolled.scrollTop =
|
||||||
|
ref.dom.offsetTop - scrolled.scrollTop - context.scroll_offset
|
||||||
|
}
|
||||||
|
|
||||||
// keep focus where it is...
|
// keep focus where it is...
|
||||||
var focused = this.focused
|
var focused = this.focused
|
||||||
@ -5023,6 +5030,7 @@ var HTMLBrowserPrototype = {
|
|||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
// prepare for maintaining the scroll position...
|
// prepare for maintaining the scroll position...
|
||||||
|
// XXX this should be done in render...
|
||||||
var ref = context.scroll_reference = this.focused || this.pagetop
|
var ref = context.scroll_reference = this.focused || this.pagetop
|
||||||
context.scroll_offset =
|
context.scroll_offset =
|
||||||
context.scroll_offset
|
context.scroll_offset
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user