LukeMurphey / splunk-dashboard-tabs-example

An example of the use of tabs on a Splunk dashboard. #splunk
MIT License
21 stars 11 forks source link

Conflicts with depends="$token$" #6

Open fredclown opened 1 year ago

fredclown commented 1 year ago

I have found that the tabs conflict with depends="$token$". The main reason for this is that you are using the jQuery show() and hide() functions which add inline styles that override the hide css class added by depends="$token$". I would suggest this change that I believe would fix this issue and allow the expected behavior.

tabs.css - add class row-hide

.row-hide {
    display: none;
}

tabs.js - change show and hide lines to use removeClass and addClass

...
var hideTabTargets = function(tabSetClass) {
...
                //$('#' + targets[d], this.$el).hide();
                $('#' + targets[d], this.$el).addClass('row-hide');
...
};
...
var selectTab = function (e) {
...
            //$('#' + toToggle[c], this.$el).show();
            $('#' + toToggle[c], this.$el).removeClass('row-hide');
...
};
fredclown commented 1 year ago

I created a pull request for this fix if you find it useful.