Skip to content

Commit

Permalink
Merge pull request #869 from GMOD/hide_tracklabels
Browse files Browse the repository at this point in the history
Add ability to set show_tracklabels=0 in config or &tracklabels=0 in url
  • Loading branch information
nathandunn authored Mar 22, 2017
2 parents a3c2e93 + 44cbf17 commit 12e9ef5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/HideTrackLabels/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ return declare( JBrowsePlugin,

var baseUrl = this._defaultConfig().baseUrl;
var thisB = this;
var queryParams = dojo.queryToObject( window.location.search.slice(1) );


// create the hide/show button after genome view initialization
this.browser.afterMilestone( 'initView', function() {
Expand All @@ -57,6 +59,11 @@ return declare( JBrowsePlugin,
dojo.stopEvent(event);
})
}, dojo.create('button',{},navBox)); //thisB.browser.navBox));

if(queryParams.tracklabels == 0 || thisB.browser.config.show_tracklabels == 0) {
query('.track-label').style('visibility', 'hidden')
dojo.attr(dom.byId("hidetitles-btn"),"hidden-titles",""); // if shown, hide
}
});

/* show or hide track labels
Expand Down

0 comments on commit 12e9ef5

Please sign in to comment.