PonteIneptique / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TIMELINE. CLONE -Vertical scrolling makes problematic moving around the timeline #212

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I make a huge (bigger then browser window size) Timeline object, that
has to be vertically scrollable in order to see the whole object the
browser window jumps to the top of the Timeline object every time I move it
around. To test it make a Timeline object with 2000px height and try to
move the timeline around at the bottom. You can check that out at
http://simile.mit.edu/timeline/examples/religions/religions.html as well.
IE doesn't have this problem for me.

Firefox 1.5.0.7 

[Submitted by Alf Lervåg on simile.mit.edu] 

Alf Lervåg - 06/Sep/07 04:11 AM
It seems I can't change the description of the item I cloned, so I guess
cloning was a bad idea. Anyways, I'm having this exact same problem. I'm
using the timeline-api, so according the the issue I cloned (TIMELINE-26)
it should've been fixed. Some testing shows that the page scrolls when the
input field gets focus which fits what you said about the original issue.

[ Show » ]
Alf Lervåg - 06/Sep/07 04:11 AM It seems I can't change the description of
the item I cloned, so I guess cloning was a bad idea. Anyways, I'm having
this exact same problem. I'm using the timeline-api, so according the the
issue I cloned (TIMELINE-26) it should've been fixed. Some testing shows
that the page scrolls when the input field gets focus which fits what you
said about the original issue.

[ Permlink | « Hide ]
Alf Lervåg - 06/Sep/07 08:30 AM
Can't figure out how to attach patches, so I'll just paste it here. I've
tested this in firefox 2.0.0.6, opera 9.23 and IE7.

--- scripts/timeline.js 2007-09-06 10:48:25 +0000
+++ scripts/timeline.js 2007-09-06 12:19:26 +0000
@@ -702,6 +702,12 @@

Timeline._Band.prototype._onMouseUp = function(innerFrame, evt, target) {
     this._dragging = false;
+
+ var coords = Timeline.DOM.getEventRelativeCoordinates(evt, innerFrame);
+ var shiftX = coords.x + innerFrame.offsetLeft;
+ var shiftY = coords.y + innerFrame.offsetTop;
+ this._moveKeyboardInput(this._timeline.isHorizontal() ? shiftY : shiftX);
+
     this._keyboardInput.focus();
 };

@@ -893,3 +899,11 @@
         this._decorators[i].softPaint();
     }
 };
+
+Timeline._Band.prototype._moveKeyboardInput = function(shift) {
+ var inputDiv = this._keyboardInput.parentNode;
+ if (this._timeline.isHorizontal())
+ inputDiv.style.top = shift + "px";
+ else
+ inputDiv.style.left = shift + "px";
+}
[ Show » ]
Alf Lervåg - 06/Sep/07 08:30 AM Can't figure out how to attach patches, so
I'll just paste it here. I've tested this in firefox 2.0.0.6, opera 9.23
and IE7. --- scripts/timeline.js 2007-09-06 10:48:25 +0000 +++
scripts/timeline.js 2007-09-06 12:19:26 +0000 @@ -702,6 +702,12 @@
Timeline._Band.prototype._onMouseUp = function(innerFrame, evt, target) { 
    this._dragging = false; + + var coords =
Timeline.DOM.getEventRelativeCoordinates(evt, innerFrame); + var shiftX =
coords.x + innerFrame.offsetLeft; + var shiftY = coords.y +
innerFrame.offsetTop; +
this._moveKeyboardInput(this._timeline.isHorizontal() ? shiftY : shiftX); +
     this._keyboardInput.focus();  }; @@ -893,3 +899,11 @@         
this._decorators[i].softPaint();      }  }; +
+Timeline._Band.prototype._moveKeyboardInput = function(shift) { + var
inputDiv = this._keyboardInput.parentNode; + if
(this._timeline.isHorizontal()) + inputDiv.style.top = shift + "px"; + else
+ inputDiv.style.left = shift + "px"; +}

[ Permlink | « Hide ]
Alf Lervåg - 06/Sep/07 08:37 AM
By the way, I haven't tested this with vertical timelines; it might be that
I should've used something other than innerFrame.offsetLeft.
[ Show » ]
Alf Lervåg - 06/Sep/07 08:37 AM By the way, I haven't tested this with
vertical timelines; it might be that I should've used something other than
innerFrame.offsetLeft.

[ Permlink | « Hide ]
David F. Huynh - 29/Sep/07 09:31 PM
Thank you for the fix. I'll try to put it in later.
[ Show » ]
David F. Huynh - 29/Sep/07 09:31 PM Thank you for the fix. I'll try to put
it in later.

Original issue reported on code.google.com by GabrielR...@googlemail.com on 8 Apr 2009 at 7:16