Fixed inconsistent header shadow behavior

This commit is contained in:
squidfunk 2021-03-28 12:04:59 +02:00
parent 9f3cb049fc
commit f43ef69ee5
7 changed files with 16 additions and 12 deletions

View File

@ -217,7 +217,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.7865d441.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.749317b4.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

@ -15,5 +15,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */ ***************************************************************************** */
//# sourceMappingURL=bundle.25e8c307.min.js.map //# sourceMappingURL=bundle.e7fa8c09.min.js.map

View File

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

View File

@ -125,6 +125,13 @@ export function getElementContentSize(el: HTMLElement): ElementSize {
* termination. Note that this function should not be called with the same * termination. Note that this function should not be called with the same
* element twice, as the first unsubscription will terminate observation. * element twice, as the first unsubscription will terminate observation.
* *
* Sadly, we can't use the `DOMRect` objects returned by the observer, because
* we need the emitted values to be consistent with `getElementSize`, which will
* return the used values (rounded) and not actual values (unrounded). Thus, we
* use the `offset*` properties. See the linked GitHub issue.
*
* @see https://bit.ly/3m0k3he - GitHub issue
*
* @param el - Element * @param el - Element
* *
* @returns Element size observable * @returns Element size observable
@ -139,10 +146,7 @@ export function watchElementSize(
.pipe( .pipe(
filter(({ target }) => target === el), filter(({ target }) => target === el),
finalize(() => observer.unobserve(el)), finalize(() => observer.unobserve(el)),
map(({ contentRect }) => ({ map(() => getElementSize(el))
width: contentRect.width,
height: contentRect.height
}))
) )
), ),
startWith(getElementSize(el)) startWith(getElementSize(el))