Skip to content

Commit 6d3e454

Browse files
authored
Merge pull request #25 from javier-godoy/feature/fixed
Allow configuration of fixed and reveals properties
2 parents 1ca1b3a + 0269a43 commit 6d3e454

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

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

Lines changed: 12 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);
@@ -69,7 +68,17 @@ public void setMenuIconVisible(boolean visible) {
6968
appToolbar.setMenuIconVisible(visible);
7069
}
7170

72-
void setHeight(String height) {
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+
}
80+
81+
void setHeight(String height) {
7382
appToolbar.getElement().getStyle().set("height", height);
7483
}
7584

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,14 @@ public void setCaption(String caption) {
108108
public void configurePage(InitialPageSettings settings) {
109109
settings.addMetaTag("viewport", "width=device-width, initial-scale=1.0");
110110
}
111-
111+
112+
/**Mantains the header fixed at the top so it never moves away.*/
113+
public void setFixed(boolean fixed) {
114+
header.setFixed(fixed);
115+
}
116+
117+
/**Slides back the header when scrolling back up.*/
118+
public void setReveals(boolean reveals) {
119+
header.setReveals(reveals);
120+
}
112121
}

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
@@ -48,6 +48,7 @@
4848
position: var(--layout-fixed-top_-_position); top: var(--layout-fixed-top_-_top); left: var(--layout-fixed-top_-_left); right: var(--layout-fixed-top_-_right);
4949
color: #fff;
5050
--app-header-background-rear-layer_-_background-color: #ef6c00;;
51+
z-index: 1000;
5152
}
5253

5354
app-drawer {

0 commit comments

Comments
 (0)