Skip to content

Commit c6bbb92

Browse files
committed
fix: fix currency sign choosing on error
1 parent 7256cdb commit c6bbb92

File tree

1 file changed

+10
-6
lines changed
  • src/main/webapp/WEB-INF/views/series

1 file changed

+10
-6
lines changed

src/main/webapp/WEB-INF/views/series/info.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,12 +1124,6 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
11241124
src="../../../../javascript/series/info.js"
11251125
th:src="${SERIES_INFO_JS}"></script>
11261126

1127-
<script sec:authorize="hasAuthority('CREATE_SERIES')">
1128-
window.addEventListener('DOMContentLoaded', function initPage() {
1129-
initPriceCatalog();
1130-
});
1131-
</script>
1132-
11331127
<!--/*/
11341128
<th:block sec:authorize="hasAnyAuthority('IMPORT_SERIES_SALES', 'MARK_SIMILAR_SERIES', 'CREATE_SERIES', 'ADD_COMMENTS_TO_SERIES', 'HIDE_IMAGE')">
11351129
/*/-->
@@ -1173,6 +1167,16 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
11731167
}
11741168
}
11751169
});
1170+
1171+
// https://htmx.org/events/#htmx:load
1172+
document.body.addEventListener('htmx:load', function htmxLoadEventHandler(event) {
1173+
// NOTE: htmx:load event fires in the beginning, when a page has been loaded, and when a new element
1174+
// has been placed after AJAX request. In both cases we need to register custom event listener for the
1175+
// add catalog price form. Also, we don't need to do anything, if updated element belongs to another form.
1176+
if (event.detail.elt.querySelector('#price-catalog-name') != null) {
1177+
initPriceCatalog();
1178+
}
1179+
});
11761180
</script>
11771181
/*/-->
11781182
<script th:inline="javascript">

0 commit comments

Comments
 (0)