Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline Events Icons #35

Open
ghost opened this issue Jan 19, 2015 · 0 comments
Open

Timeline Events Icons #35

ghost opened this issue Jan 19, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 19, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants