Skip to content

Commit

Permalink
Address CR, clear up code
Browse files Browse the repository at this point in the history
  • Loading branch information
ihodes committed Nov 24, 2014
1 parent 767ed89 commit 8d83f30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 4 additions & 0 deletions cycledash/static/js/examine/RecordStore.js
Expand Up @@ -111,6 +111,10 @@ function createRecordStore(vcfId, dispatcher) {
var query = queryFrom(range, filters, sortBys, page, limit);
setSearchStringToQuery(query);

// If we're not just appending records, reset the selected records (as the
// table is now invalidated).
if (!append) selectedRecord = null;

$.when(deferredGenotypes(vcfId, query))
.done(response => {
if (append) {
Expand Down
1 change: 0 additions & 1 deletion cycledash/static/js/examine/components/BioDalliance.js
Expand Up @@ -32,7 +32,6 @@ var BioDalliance = React.createClass({
tumorBaiChunks: CHUNKS_LOADING,
}),
render: function() {
console.log('PROPS:', this.props);
var style = {};
if (!this.props.selectedRecord ||
this.state.normalBaiChunks == CHUNKS_LOADING ||
Expand Down
10 changes: 1 addition & 9 deletions cycledash/static/js/examine/components/VCFTable.js
Expand Up @@ -249,7 +249,7 @@ var VCFTableBody = React.createClass({
<VCFRecord record={record}
columns={this.props.columns}
key={key}
isSelected={sameRecord(selectedRecord, record)} />
isSelected={selectedRecord === record} />
);
});
return (
Expand Down Expand Up @@ -292,12 +292,4 @@ var VCFRecord = React.createClass({
}
});

// Returns true if a, b are the same. Compares contig, position, ref & alt.
function sameRecord(a, b) {
var keys = ['contig', 'position', 'reference', 'alternates'],
a = _.pick(a, keys),
b = _.pick(b, keys);
return _.isEqual(a, b);
}

module.exports = VCFTable;

0 comments on commit 8d83f30

Please sign in to comment.