Skip to content

Timeline Events Icons #35

Description

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions