Skip to content

Commit 9298018

Browse files
author
aklabox
committed
Navbar bug fixed on small devices and Material Parallax Image is fixed
1 parent 8569b8e commit 9298018

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/main/java/gwt/material/design/client/ui/MaterialNavBar.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ interface MaterialNavBarUiBinder extends UiBinder<Widget, MaterialNavBar> {
4646
@UiField
4747
CustomAnchor anchor, navMenu;
4848

49-
private String name = "sample";
5049
private String color = "";
5150
private String type = "";
5251
private String align = "";
@@ -70,7 +69,11 @@ public MaterialNavBar() {
7069
@Override
7170
protected void onAttach() {
7271
super.onAttach();
72+
String name = String.valueOf(hashCode());
73+
navMenu.getElement().setAttribute("data-activates", name);
74+
mobileNav.getElement().setId(name);
7375
initNavBar();
76+
7477
}
7578

7679
@UiChild(tagname = "nav")
@@ -194,16 +197,6 @@ public void setWave(String wave) {
194197
}
195198
}
196199

197-
public String getName() {
198-
return name;
199-
}
200-
201-
public void setName(String name) {
202-
this.name = name;
203-
navMenu.getElement().setAttribute("data-activates", name);
204-
mobileNav.getElement().setId(name);
205-
}
206-
207200
public String getSideBar() {
208201
return sideBar;
209202
}

src/main/resources/gwt/material/design/client/ui/MaterialParallax.ui.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@
2222
xmlns:g="urn:import:com.google.gwt.user.client.ui"
2323
xmlns:m="urn:import:gwt.material.design.client.ui">
2424
<ui:style>
25-
25+
.imgParallax{
26+
left: 50%;
27+
}
2628
</ui:style>
2729
<m:MaterialPanel>
2830
<m:MaterialPanel ui:field="imageContainer" addStyleNames="parallax-container">
2931
<m:MaterialPanel addStyleNames="parallax">
30-
<g:Image ui:field="image" />
32+
<g:Image ui:field="image" addStyleNames="{style.imgParallax}"/>
3133
</m:MaterialPanel>
3234
</m:MaterialPanel>
3335
<m:MaterialPanel addStyleNames="section white">

0 commit comments

Comments
 (0)