Skip to content

Commit

Permalink
Implemented replaceTracks for hierarchical track selector. Fixes #705
Browse files Browse the repository at this point in the history
  • Loading branch information
ihh committed Mar 3, 2016
1 parent 2608fe3 commit 1fce046
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sample_data/json/modencode/trackList.json
Original file line number Diff line number Diff line change
Expand Up @@ -18749,4 +18749,8 @@
},

"formatVersion" : 1,

"notifications" : {
"url" : "http://localhost:8000/faye"
}
}
15 changes: 15 additions & 0 deletions src/JBrowse/View/TrackList/Hierarchical.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,21 @@ return declare(
},

replaceTracks: function( trackConfigs ) {
var isChecked = {}
array.forEach( trackConfigs, function(conf) {
this._findTrack( conf.label, function( trackRecord, category ) {
isChecked[conf.label] = trackRecord.checkbox.checked;
});
},this);

this.deleteTracks (trackConfigs);
this.addTracks (trackConfigs);

array.forEach( trackConfigs, function(conf) {
this._findTrack( conf.label, function( trackRecord, category ) {
trackRecord.checkbox.checked = isChecked[conf.label];
});
},this);
},

/**
Expand Down

0 comments on commit 1fce046

Please sign in to comment.