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
Contributor

cmdcolin commented Mar 22, 2017

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

@nathandunn

This comment has been minimized.

Show comment
Hide comment
@nathandunn

nathandunn Mar 22, 2017

Contributor

thanks . . . let me test it real quick.

Contributor

nathandunn commented Mar 22, 2017

thanks . . . let me test it real quick.

@nathandunn

This comment has been minimized.

Show comment
Hide comment
@nathandunn

nathandunn Mar 22, 2017

Contributor

Awesome, thanks. Works great.

Contributor

nathandunn 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.

Show comment
Hide comment
@bhofmei

bhofmei 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.

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

This comment has been minimized.

Show comment
Hide comment
@cmdcolin

This comment has been minimized.

Show comment
Hide comment
@cmdcolin

cmdcolin Jun 14, 2017

Contributor

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

Contributor

cmdcolin 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.

Show comment
Hide comment
@cmdcolin

cmdcolin Jun 19, 2017

Contributor

@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')
            })
        }
    }

});
});
Contributor

cmdcolin 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.

Show comment
Hide comment
@bhofmei

bhofmei Jun 20, 2017

bhofmei 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