Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set show_tracklabels=0 in config or &tracklabels=0 in url #869

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

cmdcolin
Copy link
Contributor

Addresses #868 request, but requires that the hidetracklabels plugin is enabled.

@enuggetry enuggetry added the in progress currently being worked on label Mar 22, 2017
@nathandunn nathandunn added the in progress currently being worked on label Mar 22, 2017
@nathandunn
Copy link
Contributor

thanks . . . let me test it real quick.

@nathandunn
Copy link
Contributor

Awesome, thanks. Works great.

@nathandunn nathandunn merged commit 12e9ef5 into master Mar 22, 2017
@nathandunn nathandunn removed in progress currently being worked on labels Mar 22, 2017
@cmdcolin cmdcolin deleted the hide_tracklabels branch March 22, 2017 19:01
@bhofmei
Copy link

bhofmei commented Jun 14, 2017

In case no one noticed, using "&tracklabels=0" in the URL only works when HideTrackLabels plugin is activated. It's not a big deal since it's easy to add the plugin, but this could cause a lot of confusion and it's also a bit annoying when I want to be able to hide track labels but don't want the extra button in the toolbar.

@cmdcolin
Copy link
Contributor Author

@cmdcolin
Copy link
Contributor Author

oh wait you mention the different issue which is that it only works when plugin loaded which is true ^_^

@cmdcolin
Copy link
Contributor Author

@bhofmei as a stopgap, if you just want the URL parameter to be available and no button e.g. &tracklabels=0 you could replace plugins/HideTrackLabels/js/main.js with this

define([
            'dojo/_base/declare',
            'dojo/_base/lang',
            'dojo/query',
            'JBrowse/Plugin'
       ],
       function(
           declare,
           lang,
           query,
           JBrowsePlugin
       ) {
return declare( JBrowsePlugin,
{
    constructor: function( args ) {
        console.log("plugin HideTracksButton constructor");

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


        if(queryParams.tracklabels == 0 || thisB.browser.config.show_tracklabels == 0) {
            thisB.browser.subscribe('/jbrowse/v1/n/tracks/redraw', function() {
                query('.track-label').style('visibility', 'hidden')
            })
        }
    }

});
});

@bhofmei
Copy link

bhofmei commented Jun 20, 2017 via email

@rbuels rbuels added the feature req this adds new functionality to JBrowse 1 label Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature req this adds new functionality to JBrowse 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants