Fixed linter errors

This commit is contained in:
squidfunk 2021-02-12 13:38:18 +01:00
parent 02f6a1feab
commit f7907fc09c
5 changed files with 38 additions and 14 deletions

View File

@ -46,3 +46,31 @@ export function resetFocusable(
): void {
el.removeAttribute("tabindex")
}
/**
* Set scroll lock
*
* @param el - Scrollable element
* @param value - Vertical offset
*/
export function setScrollLock(
el: HTMLElement, value: number
): void {
el.setAttribute("data-md-state", "lock")
el.style.top = `-${value}px`
}
/**
* Reset scroll lock
*
* @param el - Scrollable element
*/
export function resetScrollLock(
el: HTMLElement
): void {
const value = -1 * parseInt(el.style.top, 10)
el.removeAttribute("data-md-state")
el.style.top = ""
if (value)
window.scrollTo(0, value)
}

View File

@ -24,7 +24,10 @@ import { Observable, merge } from "rxjs"
import { filter, sample, take } from "rxjs/operators"
import { configuration } from "~/_"
import { requestJSON, getElementOrThrow } from "~/browser"
import {
getElementOrThrow,
requestJSON
} from "~/browser"
import {
SearchIndex,
isSearchQueryMessage,

View File

@ -20,12 +20,14 @@
* IN THE SOFTWARE.
*/
/* eslint-disable */
import { filter } from "fuzzaldrin-plus"
import { from, fromEvent } from "rxjs"
import { getElement, getElementOrThrow } from "browser"
import { map, switchMap } from "rxjs/operators"
import { getElement, getElementOrThrow } from "~/browser"
import { renderIconSearch } from "./templates/icon"
// Obtain configuration

View File

@ -20,6 +20,8 @@
* IN THE SOFTWARE.
*/
/* eslint-disable */
import { wrap } from "fuzzaldrin-plus"
import { h, round } from "utilities"

View File

@ -96,17 +96,6 @@
{% block scripts %}
{{ super() }}
<!-- Application configuration -->
{% block config %}
{%- set configuration = {
"base": base_url,
"features": features
} -%}
<script id="__config" type="application/json">
{{- configuration | tojson -}}
</script>
{% endblock %}
<!-- Extra JavaScript -->
<script src="{{ 'overrides/assets/javascripts/bundle.js' | url }}"></script>
{% endblock %}