Skip to content

Commit

Permalink
use browser's known track types to guess track types based on the sto…
Browse files Browse the repository at this point in the history
…re type, if no track type is specified in config
  • Loading branch information
rbuels committed May 1, 2018
1 parent a9eaaa2 commit a3ee663
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/JBrowse/GenomeView.js
Expand Up @@ -2304,20 +2304,17 @@ renderTrack: function( /**Object*/ trackConfig ) {

// get the store
this.browser.getStore( trackConfig.store, function( s ) {
store = s;
if( trackClass && store )
makeTrack();
});

// get the track class
dojo.global.require( [ trackConfig.type ], function( class_ ) {
if(typeof class_ === "string") {
console.error("Failed to load module: "+trackConfig.type);
return;
}
trackClass = class_;
if( trackClass && store )
store = s;
// get the track class
var trackType = trackConfig.type || thisB.browser.getTrackTypes().trackTypeDefaults[store.config.type]
dojo.global.require( [ trackType ], function( class_ ) {
if(typeof class_ === "string") {
console.error("Failed to load module: "+trackConfig.type);
return;
}
trackClass = class_;
makeTrack();
});
});

return trackDiv;
Expand Down

0 comments on commit a3ee663

Please sign in to comment.