Skip to content

Commit 95e8227

Browse files
committed
Allow configuration of fixed and reveals properties
1 parent 5c1d4e9 commit 95e8227

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

src/main/java/com/flowingcode/addons/applayout/AppHeader.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public AppHeader(String title, AppDrawer drawer) {
4545
}
4646

4747
public AppHeader(Image logo, String title, AppDrawer drawer) {
48-
this.getElement().setAttribute("reveals", true);
49-
this.getElement().setAttribute("condenses", true);
48+
setReveals(true);
5049
this.getElement().setAttribute("effects", true);
5150
appToolbar = new AppToolbar(logo, title, drawer);
5251
this.add(appToolbar);
@@ -68,5 +67,14 @@ public void setToolbarIconButtons(MenuItem[] menuItems) {
6867
public void setMenuIconVisible(boolean visible) {
6968
appToolbar.setMenuIconVisible(visible);
7069
}
71-
70+
71+
/**Mantains the header fixed at the top so it never moves away.*/
72+
public void setFixed(boolean fixed) {
73+
this.getElement().setAttribute("fixed", fixed);
74+
}
75+
76+
/**Slides back the header when scrolling back up.*/
77+
public void setReveals(boolean reveals) {
78+
this.getElement().setAttribute("reveals", reveals);
79+
}
7280
}

src/main/java/com/flowingcode/addons/applayout/AppLayout.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,14 @@ public boolean isMenuVisible() {
9797
public void configurePage(InitialPageSettings settings) {
9898
settings.addMetaTag("viewport", "width=device-width, initial-scale=1.0");
9999
}
100-
100+
101+
/**Mantains the header fixed at the top so it never moves away.*/
102+
public void setFixed(boolean fixed) {
103+
header.setFixed(fixed);
104+
}
105+
106+
/**Slides back the header when scrolling back up.*/
107+
public void setReveals(boolean reveals) {
108+
header.setReveals(reveals);
109+
}
101110
}

src/main/resources/META-INF/resources/frontend/styles/applayout-styles.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
position: var(--layout-fixed-top_-_position); top: var(--layout-fixed-top_-_top); left: var(--layout-fixed-top_-_left); right: var(--layout-fixed-top_-_right);
4545
color: #fff;
4646
--app-header-background-rear-layer_-_background-color: #ef6c00;;
47+
z-index: 1000;
4748
}
4849

4950
app-drawer {

0 commit comments

Comments
 (0)