Fixed details breaking page margins on print

This commit is contained in:
squidfunk 2021-05-15 14:07:34 +02:00
parent 86c05e84a3
commit 920f11cf6e
7 changed files with 12 additions and 17 deletions

View File

@ -223,7 +223,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.bf05ca82.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.3d775e71.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %} {% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script> <script src="{{ path | url }}"></script>
{% endfor %} {% endfor %}

View File

@ -35,5 +35,5 @@
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.76b3621f.min.js' | url }}"></script> <script src="{{ 'overrides/assets/javascripts/bundle.a8d8885a.min.js' | url }}"></script>
{% endblock %} {% endblock %}

View File

@ -24,11 +24,9 @@ import {
NEVER, NEVER,
Observable, Observable,
fromEvent, fromEvent,
fromEventPattern, fromEventPattern
merge
} from "rxjs" } from "rxjs"
import { import {
filter,
mapTo, mapTo,
startWith, startWith,
switchMap switchMap
@ -66,10 +64,7 @@ export function watchMedia(query: string): Observable<boolean> {
* @returns Print mode observable * @returns Print mode observable
*/ */
export function watchPrint(): Observable<void> { export function watchPrint(): Observable<void> {
return merge( return fromEvent(window, "beforeprint")
watchMedia("print").pipe(filter(Boolean)), /* Webkit */
fromEvent(window, "beforeprint") /* IE, FF */
)
.pipe( .pipe(
mapTo(undefined) mapTo(undefined)
) )