Skip to content

Commit

Permalink
fix: use setProperty instead of setAttribute
Browse files Browse the repository at this point in the history
Close #38
  • Loading branch information
javier-godoy committed Mar 8, 2024
1 parent 6b13868 commit 3acace7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
@JsModule("@xpertsea/paper-slider/l2t-paper-slider.js")
public class Carousel extends Component implements HasSize {

private static final String HIDE_NAV = "hide-nav";
private static final String DISABLE_SWIPE = "disable-swipe";
private static final String HIDE_NAV = "hideNav";
private static final String DISABLE_SWIPE = "disableSwipe";
private static final String POSITION = "position";
private static final String SLIDE_DURATION = "slide-duration";
private static final String AUTO_PROGRESS = "auto-progress";
private static final String SLIDE_DURATION = "slideDuration";
private static final String AUTO_PROGRESS = "autoProgress";
private static final int DEFAULT_SLIDE_DURATION = 2;

private Slide[] slides;
Expand Down Expand Up @@ -87,7 +87,7 @@ public boolean isAutoProgress() {
}

public void setAutoProgress(boolean autoProgress) {
getElement().setAttribute(AUTO_PROGRESS, autoProgress);
getElement().setProperty(AUTO_PROGRESS, autoProgress);
}

public int getSlideDuration() {
Expand All @@ -103,23 +103,23 @@ public int getStartPosition() {
}

public void setStartPosition(int startPosition) {
getElement().setAttribute(POSITION, "" + startPosition);
getElement().setProperty(POSITION, startPosition);
}

public boolean isDisableSwipe() {
return getElement().getProperty(DISABLE_SWIPE, false);
}

public void setDisableSwipe(boolean disableSwipe) {
getElement().setAttribute(DISABLE_SWIPE, disableSwipe);
getElement().setProperty(DISABLE_SWIPE, disableSwipe);
}

public boolean isHideNavigation() {
return getElement().getProperty(HIDE_NAV, false);
}

public void setHideNavigation(boolean hideNavigation) {
getElement().setAttribute(HIDE_NAV, hideNavigation);
getElement().setProperty(HIDE_NAV, hideNavigation);
}

// FLUENT API
Expand Down

0 comments on commit 3acace7

Please sign in to comment.