mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 10:00:52 +01:00
Fixed linter errors
This commit is contained in:
parent
02f6a1feab
commit
f7907fc09c
@ -46,3 +46,31 @@ export function resetFocusable(
|
|||||||
): void {
|
): void {
|
||||||
el.removeAttribute("tabindex")
|
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)
|
||||||
|
}
|
||||||
|
@ -24,7 +24,10 @@ import { Observable, merge } from "rxjs"
|
|||||||
import { filter, sample, take } from "rxjs/operators"
|
import { filter, sample, take } from "rxjs/operators"
|
||||||
|
|
||||||
import { configuration } from "~/_"
|
import { configuration } from "~/_"
|
||||||
import { requestJSON, getElementOrThrow } from "~/browser"
|
import {
|
||||||
|
getElementOrThrow,
|
||||||
|
requestJSON
|
||||||
|
} from "~/browser"
|
||||||
import {
|
import {
|
||||||
SearchIndex,
|
SearchIndex,
|
||||||
isSearchQueryMessage,
|
isSearchQueryMessage,
|
||||||
|
@ -20,12 +20,14 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
import { filter } from "fuzzaldrin-plus"
|
import { filter } from "fuzzaldrin-plus"
|
||||||
import { from, fromEvent } from "rxjs"
|
import { from, fromEvent } from "rxjs"
|
||||||
|
|
||||||
import { getElement, getElementOrThrow } from "browser"
|
|
||||||
import { map, switchMap } from "rxjs/operators"
|
import { map, switchMap } from "rxjs/operators"
|
||||||
|
|
||||||
|
import { getElement, getElementOrThrow } from "~/browser"
|
||||||
|
|
||||||
import { renderIconSearch } from "./templates/icon"
|
import { renderIconSearch } from "./templates/icon"
|
||||||
|
|
||||||
// Obtain configuration
|
// Obtain configuration
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
import { wrap } from "fuzzaldrin-plus"
|
import { wrap } from "fuzzaldrin-plus"
|
||||||
import { h, round } from "utilities"
|
import { h, round } from "utilities"
|
||||||
|
|
||||||
|
@ -96,17 +96,6 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|
||||||
<!-- Application configuration -->
|
|
||||||
{% block config %}
|
|
||||||
{%- set configuration = {
|
|
||||||
"base": base_url,
|
|
||||||
"features": features
|
|
||||||
} -%}
|
|
||||||
<script id="__config" type="application/json">
|
|
||||||
{{- configuration | tojson -}}
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
<!-- Extra JavaScript -->
|
<!-- Extra JavaScript -->
|
||||||
<script src="{{ 'overrides/assets/javascripts/bundle.js' | url }}"></script>
|
<script src="{{ 'overrides/assets/javascripts/bundle.js' | url }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user