Skip to content

Commit

Permalink
bugfix to text searching
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed May 17, 2012
1 parent ea3c790 commit b1ca07b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/Model/TrackMetaData.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,10 @@ dojo.declare( 'JBrowse.Model.TrackMetaData', null,
// our search criteria
var filteredSets = [];
if( textFilter ) {
filteredSets.push( dojo.filter( dojof.values( this.identIndex ), textFilter ) );
filteredSets.push(
dojo.filter( dojof.values( this.identIndex ), textFilter )
.sort( dojo.hitch(this,'_itemSortFunc') )
);
filteredSets[0].facetName = 'Contains text';
}
filteredSets.push.apply( filteredSets,
Expand All @@ -413,6 +416,7 @@ dojo.declare( 'JBrowse.Model.TrackMetaData', null,
dojo.forEach( filteredSets, function(s) {
s.myOffset = 0;
s.topItem = function() { return this[this.myOffset]; };
s.shift = function() { this.myOffset++; };
});

// init counts
Expand Down Expand Up @@ -467,7 +471,7 @@ dojo.declare( 'JBrowse.Model.TrackMetaData', null,
}
}

dojo.forEach( setsByTopIdent[ ident ], function(s) { s.myOffset++; leftToProcess--; });
dojo.forEach( setsByTopIdent[ ident ], function(s) { s.shift(); leftToProcess--; });
}
}

Expand Down

0 comments on commit b1ca07b

Please sign in to comment.