Skip to content

Commit

Permalink
Fix for conflict with depends="$token$"
Browse files Browse the repository at this point in the history
* Added css class

Added row-hide CSS class for fixing issue with tabs and depends="$token$".

* Fixed issue with using jQuery show() and hide()

Changed logic to add and remove a class rather than use show() and and hide() as the inline styles added with show() and hide() were messing with rows hidden with depends="$token$".
  • Loading branch information
fredclown committed Nov 30, 2022
1 parent e358160 commit 7baf110
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/appserver/static/tabs.css
Expand Up @@ -43,3 +43,7 @@
.dashboard-panel[class*="dashboardPanel---pages-dark"] ul.nav-tabs li.active a {
color: #ffffff;
}

.row-hide {
display: none;
}
6 changes: 3 additions & 3 deletions src/appserver/static/tabs.js
Expand Up @@ -31,7 +31,7 @@ require(['jquery','underscore','splunkjs/mvc', 'bootstrap.tab', 'splunkjs/mvc/si
var targets = $(tabs[c]).data("elements").split(",");

for (var d = 0; d < targets.length; d++) {
$('#' + targets[d], this.$el).hide();
$('#' + targets[d], this.$el).addClass('row-hide');
}
}
};
Expand Down Expand Up @@ -111,7 +111,7 @@ require(['jquery','underscore','splunkjs/mvc', 'bootstrap.tab', 'splunkjs/mvc/si
for(var c = 0; c < toToggle.length; c++){

// Show the items
$('#' + toToggle[c], this.$el).show();
$('#' + toToggle[c], this.$el).removeClass('row-hide');

// Re-render the panels under the item if necessary
rerenderPanels(toToggle[c]);
Expand Down Expand Up @@ -237,4 +237,4 @@ require(['jquery','underscore','splunkjs/mvc', 'bootstrap.tab', 'splunkjs/mvc/si
};

firstTimeTabSetup();
});
});

0 comments on commit 7baf110

Please sign in to comment.