1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

chore: add debounce to setSubtitleOffset

This commit is contained in:
Ivan Schurawel 2023-02-19 17:29:34 -05:00 committed by Ivan Schurawel
parent 032d03d201
commit acdbf59b50

View file

@ -32,6 +32,7 @@ import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../components/backdrop/backdrop';
import Events from '../../utils/events.ts';
import { includesAny } from '../../utils/container.ts';
import debounce from 'lodash-es/debounce';
/**
* Returns resolved URL.
@ -571,7 +572,12 @@ function tryRemoveElement(elem) {
}
}
setSubtitleOffset(offset) {
setSubtitleOffset = debounce(this._setSubtitleOffset, 500);
/**
* @private
*/
_setSubtitleOffset(offset) {
const offsetValue = parseFloat(offset);
// if .ass currently rendering