Skip to content

Commit 86f6b9e

Browse files
committed
Fixed a bug with coverage wiping out the sequence when no coverage
was specified.
1 parent d842fdb commit 86f6b9e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-sequence-viewer",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "A React wrapper around the BioJS sequence-viewer component",
55
"main": "lib/index.js",
66
"jsnext:main": "es/index.js",

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ export default class ReactSequenceViewer extends Component {
3131
//Render div if it is not null.
3232
if (div !== null) {
3333
this._seqObj.render('#' + div.id,{...props,...newProps});
34-
this._seqObj.coverage(this.props.coverage);
35-
this._seqObj.addLegend(this.props.legend);
34+
if (this.props.coverage.length > 0) this._seqObj.coverage(this.props.coverage);
35+
if (this.props.legend.length > 0) this._seqObj.addLegend(this.props.legend);
3636
if (selection.length > 0) this._seqObj.selection(...selection);
3737
}
3838
}
3939

4040
// When the component mounts, add a change listenver to the document
4141
// and call render. We attach the change listener here becuase
42-
// jQuery events don't see to bubble up through React properly.
43-
// Thus, when a user toggles the charsPerLine drop down menu.
42+
// jQuery events don't bubble up through React due to its synthetic event
43+
// handling. Thus, when a user toggles the charsPerLine drop down menu.
4444
// the event is handled by jQuery, but not seen by React when the
4545
// listener is attached at the component div level.
4646
// Attaching it to the document seems to work.

0 commit comments

Comments
 (0)