Comments (6)
Bug verified by LarryK on IE 7. Works correctly on Chrome
Original comment by [email protected]
on 25 Sep 2008 at 5:36
- Changed title: TIMELINE: syncronization problem in IE with bandinfo and decorator
- Changed state: Accepted
from simile-widgets.
I have a hack that makes the double click work correctly (for me anyway) for
events
in the timeline.
In timeline.js, replace Timeline._Band.prototype._onDblClick() with
Timeline._Band.prototype._onDblClick = function(innerFrame, evt, target) {
var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame);
if(SimileAjax.Platform.browser.isIE){
if(evt.type!="mousewheel"){
var className = target.className;
var elemName = target.nodeName;
if (className == "timeline-event-label" ||
className == "timeline-small-event-icon" ||
className == "timeline-event-icon") {
var xLocation = parseInt(target.offsetLeft);
var yLocation = parseInt(target.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
else if (elemName == "IMG" &&
target.parentNode.className == "timeline-event-icon") {
var xLocation = parseInt(target.parentNode.offsetLeft);
var yLocation = parseInt(target.parentNode.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
}
}
var distance = coords.x - (this._viewLength / 2 - this._viewOffset);
this._autoScroll(-distance);
};
Original comment by [email protected]
on 15 Dec 2008 at 11:27
from simile-widgets.
Here is a better version that works for duration events as well.
if(SimileAjax.Platform.browser.isIE){
var className = target.className;
var elemName = target.nodeName;
if (className == "timeline-event-label" ||
className == "timeline-small-event-icon" ||
className == "timeline-event-icon" ||
className == "timeline-event-tape") {
var xLocation = parseInt(target.offsetLeft);
var yLocation = parseInt(target.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
else if (elemName == "IMG" &&
target.parentNode.className == "timeline-event-icon") {
var xLocation = parseInt(target.parentNode.offsetLeft);
var yLocation = parseInt(target.parentNode.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
}
Original comment by [email protected]
on 16 Dec 2008 at 5:18
from simile-widgets.
Hi,
based on the work from riddle I´ve managed to build a workaround for my issue.
The change suggested from riddle in version 2.3.0 has moved from timeline.js to
band.js
My html code regardingh highlight is as follow :
....
<div class="timeline-highlight-decorator" style="background-color: rgb(255, 192,
128); opacity: 0.3; left: 900.226px; width: 729.032px;"/>
<table class="timeline-highlight-label timeline-highlight-label-start"
style="right:
2399.77px; width: 6em;">
<tbody>
<tr>
<td>Startr</td>
</tr>
</tbody>
</table>
...
So I had to make a change in the above code make it work for me. I´ve add this
...
}else if
(target.parentNode.parentNode.parentNode.className.indexOf("timeline-highlight-l
abel")!=-1){
var xLocation = parseInt(target.parentNode.parentNode.parentNode.offsetLeft);
var yLocation = parseInt(target.parentNode.parentNode.parentNode.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
....
the whole code would be like
Timeline._Band.prototype._onDblClick = function(innerFrame, evt, target) {
var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame);
if(SimileAjax.Platform.browser.isIE){
var className = target.className;
var elemName = target.nodeName;
if (className == "timeline-event-label" || className == "timeline-small-event-icon"
|| className == "timeline-event-icon" || className == "timeline-event-tape"){
var xLocation = parseInt(target.offsetLeft);
var yLocation = parseInt(target.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}else if
(target.parentNode.parentNode.parentNode.className.indexOf("timeline-highlight-l
abel")!=-1){
var xLocation = parseInt(target.parentNode.parentNode.parentNode.offsetLeft);
var yLocation = parseInt(target.parentNode.parentNode.parentNode.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
else if (elemName == "IMG" && target.parentNode.className == "timeline-event-icon") {
var xLocation = parseInt(target.parentNode.offsetLeft);
var yLocation = parseInt(target.parentNode.offsetTop);
coords.x = xLocation;
coords.y = yLocation;
}
}
var distance = coords.x - (this._viewLength / 2 - this._viewOffset);
this._autoScroll(-distance);
};
This problem is definitely on coords.x value and the workaround is to guess the
parentNode.offsetLeft value.
I hope this could help to find a final fix.
Thanks
Original comment by [email protected]
on 9 Mar 2009 at 1:59
from simile-widgets.
Original comment by [email protected]
on 25 Mar 2009 at 7:01
- Added labels: Project-Timeline
from simile-widgets.
i have fixed this issue by replacing the following code in api/scripts/band.js :
Timeline._Band.prototype._onDblClick = function(innerFrame, evt, target) {
var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame);
var distance = coords.x - (this._viewLength / 2 - this._viewOffset);
this._autoScroll(-distance);
};
with the followin:
Timeline._Band.prototype._onDblClick = function(innerFrame, evt, target) {
var distance = evt.clientX - 740;
this._autoScroll(-distance);
};
the static value " 740 " is a value that i mesured manually, i think it is
something
related to the timeline width.
Original comment by [email protected]
on 2 Aug 2009 at 1:15
from simile-widgets.
Related Issues (20)
- Suggestion to move project to GitHub HOT 2
- Cannot get any current events to show up
- Cannot get any current event to show up URG!
- Timeline doesn't support a multilingual website under wordpress
- Labels with same text combined
- Expanding an entry on the monet timeline example does not work on an iOS device
- Undefined: Timeline.GregorianDateLabeller.getMonthNames
- how to use Scripted Event API
- Pure millisecond events not properly aligned on timeline; some false errors.
- please remove eval from timeline_source_v2.3.0.zip\timeline_2.3.0\src\webapp\api\scripts\timeline.js
- [deleted issue]
- Thousands separators in axis numbers when dealing with big numbers (millions)
- No timeline in rectangle
- salam ya husain
- Problem with TimeGeometry display
- Issune in Event/Interaction tracker salesforce package
- Timeline blocked by Firefox when used on SSL-based sites. HOT 1
- Some future events are not showing up in Timeline when there are a lot of events HOT 1
- GBEAFRUBGHER
- Specific Dates Ranges Fail Before Jan 1, 100
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simile-widgets.