Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private String convertToReswap(HxReswap annotation) {
reswap.swap(Duration.ofMillis(annotation.swap()));
}
if (annotation.settle() != -1) {
reswap.swap(Duration.ofMillis(annotation.settle()));
reswap.settle(Duration.ofMillis(annotation.settle()));
}
if (annotation.transition()) {
reswap.transition();
Expand All @@ -176,7 +176,7 @@ private String convertToReswap(HxReswap annotation) {
if (annotation.show() != HxReswap.Position.UNDEFINED) {
reswap.show(convertToPosition(annotation.show()));
if (!annotation.showTarget().isEmpty()) {
reswap.scrollTarget(annotation.showTarget());
reswap.showTarget(annotation.showTarget());
}
}
if (annotation.scroll() != HxReswap.Position.UNDEFINED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void testHxReplaceUrlShouldPrependContextPath() throws Exception {
public void testHxReswap() throws Exception {
mockMvc.perform(get("/hx-reswap"))
.andExpect(status().isOk())
.andExpect(header().string("HX-Reswap", "innerHTML swap:300ms"));
.andExpect(header().string("HX-Reswap", "innerHTML transition:true focus-scroll:true swap:0ms settle:500ms scroll:#scrollTarget:top show:#showTarget:bottom"));
}

@Test
Expand Down Expand Up @@ -312,7 +312,15 @@ public String hxReplaceUrlFalse() {
}

@GetMapping("/hx-reswap")
@HxReswap(value = HxSwapType.INNER_HTML, swap = 300)
@HxReswap(value = HxSwapType.INNER_HTML,
swap = 0,
settle = 500,
scroll = HxReswap.Position.TOP,
scrollTarget = "#scrollTarget",
show = HxReswap.Position.BOTTOM,
showTarget = "#showTarget",
transition = true,
focusScroll = HxReswap.FocusScroll.TRUE)
@ResponseBody
public String hxReswap() {
return "";
Expand Down