Skip to content

Commit

Permalink
display details of subfeatures in default feature detail pane, refere…
Browse files Browse the repository at this point in the history
…nces #125
  • Loading branch information
rbuels committed Oct 30, 2012
1 parent 604299a commit 7d00411
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
10 changes: 6 additions & 4 deletions main.css
Expand Up @@ -602,13 +602,15 @@ a.dialog-new-window {
}

/* styles for popup feature detail dialogs from tracks */
.dijitDialogPaneContent .feature-detail {
margin-top: -0.6em;
}

.feature-detail {
padding-top: 1em;
}
.feature-detail .subfeature-detail {
background: #fafafa;
background: rgba( 0, 0, 0, 0.1 );
border: 1px outset #B9B9B9
}

.detail .value {
margin-left: 1em;
display: inline-block;
Expand Down
22 changes: 20 additions & 2 deletions src/JBrowse/View/Track/HTMLFeatures.js
Expand Up @@ -156,9 +156,9 @@ HTMLFeatures = declare( HTMLFeatures,
* Make a default feature detail page for the given feature.
* @returns {HTMLElement} feature detail page HTML
*/
defaultFeatureDetail: function( /** JBrowse.Track */ track, /** Object */ f, /** HTMLElement */ div ) {
defaultFeatureDetail: function( /** JBrowse.Track */ track, /** Object */ f, /** HTMLElement */ featDiv, /** HTMLElement */ container ) {
var fmt = dojo.hitch( this, '_fmtDetailField' );
var container = dojo.create('div', { className: 'detail feature-detail feature-detail-'+track.name, innerHTML: '' } );
container = container || dojo.create('div', { className: 'detail feature-detail feature-detail-'+track.name, innerHTML: '' } );
container.innerHTML += fmt( 'Name', f.get('name') );
container.innerHTML += fmt( 'Type', f.get('type') );
container.innerHTML += fmt( 'Description', f.get('note') );
Expand All @@ -175,6 +175,24 @@ HTMLFeatures = declare( HTMLFeatures,
container.innerHTML += fmt( t, f.get(t) );
});

var subfeatures = f.get('subfeatures');
if( subfeatures && subfeatures.length ) {
var field_container = dojo.create('div', { className: 'field_container subfeatures' }, container );
dojo.create( 'h2', { className: 'field subfeatures', innerHTML: 'Subfeatures' }, field_container );
var subfeaturesContainer = dojo.create( 'div', { className: 'value subfeatures' }, field_container );
array.forEach( subfeatures || [], function( subfeature ) {
this.defaultFeatureDetail(
track,
subfeature,
null,
dojo.create('div', {
className: 'detail feature-detail subfeature-detail feature-detail-'+track.name+' subfeature-detail-'+track.name,
innerHTML: ''
}, subfeaturesContainer )
);
},this);
}

return container;
},

Expand Down

0 comments on commit 7d00411

Please sign in to comment.