Skip to content

Commit

Permalink
Hide Card header when in Tabs (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Nov 30, 2021
1 parent 91f0178 commit d369934
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lumen/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ def _load_target(self, target_spec):
if 'reloadable' not in target_spec:
target_spec['reloadable'] = self.config.reloadable
target = Target.from_spec(target_spec, application=self)
if isinstance(self._layout, pn.Tabs):
target.show_title = False
target.start()
return target

Expand Down
5 changes: 5 additions & 0 deletions lumen/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ class Target(param.Parameterized):
reloadable = param.Boolean(default=True, doc="""
Whether to allow reloading data target's source using a button.""")

show_title = param.Boolean(default=True, doc="""
Whether to show the title in Card headers.""")

title = param.String(doc="A title for this Target.")

refresh_rate = param.Integer(default=None, doc="""
Expand Down Expand Up @@ -598,6 +601,8 @@ def panels(self):
kwargs['ncols'] = 3
if self._cards:
content = self._cards
if len(self._cards) == 1 and not self.show_title:
self._cards[0].hide_header = True
else:
content = (
pn.pane.Alert(
Expand Down

0 comments on commit d369934

Please sign in to comment.