this.initcomplete = true; this.onheight.sendEvent(); if (this.initcomplete) { this.thumb.updateHeight(); } = 0) return; this.thumb.updateHeight(); // need to do before thumb.updateY visheight = this.targetview.y + this.targetview.height; if (visheight < this.height) { // if the target view is offset because of the shift in height // update the scroll position of the target view var newy = this.height - this.targetview.height; this.targetview.setAttribute('y', newy); } else { this.thumb.updateY(); } } ]]> 0) newPos=0; maxscroll = Math.max(this.targetview.height-this.height,0); if (newPos < -maxscroll) newPos = -maxscroll; this.targetview.setAttribute('y', newPos); ]]> //debug.write("step("+n+")"); this.setPosRelative(n*stepsize); //debug.write("page("+n+")"); this.setPosRelative(n*this.height); classroot.step(-1); classroot.step(-1); classroot.thumb = this; // when the y position of the target view changes then update // the thumb position, unless the thumb causes the change if (!this.inthumbdrag) { this.updateY(); } var newY = Math.floor((-classroot.targetview.y/classroot.targetview.height) *parent.height); this.setY(newY); var newHeight = Math.floor((classroot.height/classroot.targetview.height) *parent.height); this.setHeight(newHeight); // thumbControl method becomes a method of 'thumb' // when the state is applied this.inthumbdrag = true; var target = classroot.targetview; var thumb = this; var targetpos = 0; if (target.height > thumb.classroot.height) { pos = -(thumb.y / (thumb.parent.height-thumb.height)) * (target.height - thumb.classroot.height ); } //debug.write("thumbControl pos:"+pos); target.setAttribute('y', pos); thumbpos = Math.limit(ymouse - this.ydoffset, 0, this.immediateparent.height-this.height); this.inthumbdrag = false; return thumbpos; classroot.step(1); classroot.step(1);