Fixed change of palette configuration breaking site

This commit is contained in:
squidfunk 2024-01-15 17:09:20 +07:00
parent ab5ccbe6b8
commit d87c20fafc
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
4 changed files with 8 additions and 7 deletions

View File

@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.8b606f3b.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.7389ff0e.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}

View File

@ -90,10 +90,11 @@ export function watchPalette(
}
/* Emit changes in color palette */
const index = Math.max(0, Math.min(current.index, inputs.length - 1))
return of(...inputs)
.pipe(
mergeMap(input => fromEvent(input, "change").pipe(map(() => input))),
startWith(inputs[Math.max(0, current.index)]),
startWith(inputs[index]),
map(input => ({
index: inputs.indexOf(input),
color: {