Skip to content

Commit

Permalink
Fixed change of palette configuration breaking site
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Jan 15, 2024
1 parent ab5ccbe commit d87c20f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Expand Up @@ -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 %}
Expand Down
3 changes: 2 additions & 1 deletion src/templates/assets/javascripts/components/palette/index.ts
Expand Up @@ -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: {
Expand Down

0 comments on commit d87c20f

Please sign in to comment.