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

Projects
None yet
5 participants
@cmdcolin
Copy link
Contributor

commented Mar 22, 2017

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

@nathandunn

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2017

thanks . . . let me test it real quick.

@nathandunn

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2017

Awesome, thanks. Works great.

@nathandunn nathandunn merged commit 12e9ef5 into master Mar 22, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@cmdcolin cmdcolin deleted the hide_tracklabels branch Mar 22, 2017

@bhofmei

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 14, 2017

@cmdcolin

This comment has been minimized.

Copy link
Contributor Author

commented Jun 14, 2017

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

@cmdcolin

This comment has been minimized.

Copy link
Contributor Author

commented Jun 19, 2017

@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

This comment has been minimized.

Copy link

commented Jun 20, 2017

@rbuels rbuels added the feature req label Jan 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.