Skip to content

Commit 2c45893

Browse files
javier-godoypaodb
authored andcommitted
fix: use setProperty instead of setAttribute
Close #38
1 parent 738b8b1 commit 2c45893

File tree

1 file changed

+8
-8
lines changed
  • src/main/java/com/flowingcode/vaadin/addons/carousel

1 file changed

+8
-8
lines changed

src/main/java/com/flowingcode/vaadin/addons/carousel/Carousel.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
@JsModule("@xpertsea/paper-slider/l2t-paper-slider.js")
4444
public class Carousel extends Component implements HasSize {
4545

46-
private static final String HIDE_NAV = "hide-nav";
47-
private static final String DISABLE_SWIPE = "disable-swipe";
46+
private static final String HIDE_NAV = "hideNav";
47+
private static final String DISABLE_SWIPE = "disableSwipe";
4848
private static final String POSITION = "position";
49-
private static final String SLIDE_DURATION = "slide-duration";
50-
private static final String AUTO_PROGRESS = "auto-progress";
49+
private static final String SLIDE_DURATION = "slideDuration";
50+
private static final String AUTO_PROGRESS = "autoProgress";
5151
private static final int DEFAULT_SLIDE_DURATION = 2;
5252

5353
private Slide[] slides;
@@ -87,7 +87,7 @@ public boolean isAutoProgress() {
8787
}
8888

8989
public void setAutoProgress(boolean autoProgress) {
90-
getElement().setAttribute(AUTO_PROGRESS, autoProgress);
90+
getElement().setProperty(AUTO_PROGRESS, autoProgress);
9191
}
9292

9393
public int getSlideDuration() {
@@ -103,23 +103,23 @@ public int getStartPosition() {
103103
}
104104

105105
public void setStartPosition(int startPosition) {
106-
getElement().setAttribute(POSITION, "" + startPosition);
106+
getElement().setProperty(POSITION, startPosition);
107107
}
108108

109109
public boolean isDisableSwipe() {
110110
return getElement().getProperty(DISABLE_SWIPE, false);
111111
}
112112

113113
public void setDisableSwipe(boolean disableSwipe) {
114-
getElement().setAttribute(DISABLE_SWIPE, disableSwipe);
114+
getElement().setProperty(DISABLE_SWIPE, disableSwipe);
115115
}
116116

117117
public boolean isHideNavigation() {
118118
return getElement().getProperty(HIDE_NAV, false);
119119
}
120120

121121
public void setHideNavigation(boolean hideNavigation) {
122-
getElement().setAttribute(HIDE_NAV, hideNavigation);
122+
getElement().setProperty(HIDE_NAV, hideNavigation);
123123
}
124124

125125
// FLUENT API

0 commit comments

Comments
 (0)