Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Track tooltip shortDescription impossible to load #553
From mailing list "removing metadata.description HTML tags from the track list tooltips"
This thread shows that you can't set the track.shortDescription variable or the track.metadata.shortDescription variable to override the metadata.description being shown in the tooltip in the Hierarchical track selector.
When I started testing, I saw that the tootip is loaded as
Therefore, I tried creating a track such as this:
In this case, when debugging Hierarchical.js, the track.description will be undefined.
However, if you set
Then track.description will be set to "testing"
The reason for this is because this is using the "track" variable and not "trackConf" variable, and therefore, the metadata is merged into the "track" variable.
Another strange issue arises due to the merging behavior of the track variable
Now track.description="testing" but track.shortDescription is undefined...however track.shortdescription="short" is defined. Yes...it is lower case property name. Therefore, the code for getting the track.shortDescription or track.metadata.shortDescription from Hierarchical.js fails.
I believe the code should be reading from trackConf instead of track, because the trackConf variable is much more complete and mirrors the configuration file, where the track itself is sort of mangled.
Note that the difference between track metadata and trackConf metadata is sort of interesting. For example, I previously wanted to be able to load the "category" for the hierarchical selector from external files like trackMetadata.csv, and I noticed that this category is loaded into the track variable, and not the trackConf variable. That's why I added this commit as it is: 78157b5
That sort of complicates the situation, but I think a suitable fix would mostly revolve around using trackConf instead of track, while perhaps falling back to track if we want to be able to load description from the external metadata
This patch is a basic fix that doesn't allow loading from external metadata
It also says that if the description is not a string, then it is not loaded, because there are several instances in the volvox browser where it sets "description": 1. I'm not what this means but my code above, it means "don't load the description" in this case.