html5pivotviewer icon indicating copy to clipboard operation
html5pivotviewer copied to clipboard

Timeline Events Icons

Open ghost opened this issue 10 years ago • 0 comments

The current code includes the following:

if (this.timeFacets[facet].eventsData[item]._id == this.selectedItemId) {
    this.timeFacets[facet].eventsData[item]._icon = "scripts/timeline_js/images/dark-red-circle.png";
} else 
    this.timeFacets[facet].eventsData[item]._icon = "scripts/timeline_js/images/blue-circle.png";

As I discovered, for someone developing on Windows and who doesn't have the source in the scripts directory, this code will result in missing images. Rather than force the source to be in the scripts folder, a more elegant solution is to do as the timeline_js code does and use the Timeline.url_prefix variable, which results in the following code:

if (this.timeFacets[facet].eventsData[item]._id == this.selectedItemId) {
    this.timeFacets[facet].eventsData[item]._icon = Timeline.urlPrefix + "images/dark-red-circle.png";
} else 
    this.timeFacets[facet].eventsData[item]._icon = Timeline.urlPrefix + "images/dull-blue-circle.png";

(Note that I changed the image to dull-blue-circle to match the image used initially by timeline_js.)

ghost avatar Jan 19 '15 08:01 ghost