mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-22 22:03:35 -04:00
Fixed linter errors
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user