File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-sequence-viewer" ,
3
- "version" : " 0.1.3 " ,
3
+ "version" : " 0.1.4 " ,
4
4
"description" : " A React wrapper around the BioJS sequence-viewer component" ,
5
5
"main" : " lib/index.js" ,
6
6
"jsnext:main" : " es/index.js" ,
Original file line number Diff line number Diff line change @@ -31,16 +31,16 @@ export default class ReactSequenceViewer extends Component {
31
31
//Render div if it is not null.
32
32
if ( div !== null ) {
33
33
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 ) ;
36
36
if ( selection . length > 0 ) this . _seqObj . selection ( ...selection ) ;
37
37
}
38
38
}
39
39
40
40
// When the component mounts, add a change listenver to the document
41
41
// 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.
44
44
// the event is handled by jQuery, but not seen by React when the
45
45
// listener is attached at the component div level.
46
46
// Attaching it to the document seems to work.
You can’t perform that action at this time.
0 commit comments