Skip to content

Commit

Permalink
refactor(demo): add home button
Browse files Browse the repository at this point in the history
Add a "Home"-Button du go to the root of the current Tobago demo. A click on the brand leads to "https://tobago-demo.apache.org/".
  • Loading branch information
henningn committed Dec 16, 2024
1 parent e19bcfb commit e2edf16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public String gotoFirst() {
return gotoNode(tree.getTree().getNextNode()) + "?faces-redirect=true"; // the first after the root node
}

public String rootUrl() {
return tree.getTree().getNextNode().toString();
}

public String gotoPrevious() {
if (currentNode == null) {
return gotoFirst();
Expand Down
4 changes: 2 additions & 2 deletions tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<f:facet name="brand">
<!-- label="Tobago Demo" contains a NO-BREAK SPACE character -->
<tc:link image="#{request.contextPath}/image/feather-leaf.png" label="Tobago Demo" id="brand"
link="http://tobago-vm.apache.org/"/>
link="https://tobago-demo.apache.org/"/>
</f:facet>

<tc:form id="header">

<tc:links id="commands">
<tc:link id="home" label="Home" link="#{navigationState.rootUrl()}"/>

<tc:link id="config" label="Configuration" omit="true">
<tc:link label="Theme" omit="true">
Expand Down

0 comments on commit e2edf16

Please sign in to comment.