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

Fix dom addEventListener/removeEventListener for case of undefined options

This commit is contained in:
Dmitry Lyzo 2020-03-27 15:52:50 +03:00
parent 63a05df3a8
commit 000f6e776d

View file

@ -74,17 +74,17 @@ define([], function () {
} }
function addEventListenerWithOptions(target, type, handler, options) { function addEventListenerWithOptions(target, type, handler, options) {
var optionsOrCapture = options; var optionsOrCapture = options || {};
if (!supportsCaptureOption) { if (!supportsCaptureOption) {
optionsOrCapture = options.capture; optionsOrCapture = optionsOrCapture.capture;
} }
target.addEventListener(type, handler, optionsOrCapture); target.addEventListener(type, handler, optionsOrCapture);
} }
function removeEventListenerWithOptions(target, type, handler, options) { function removeEventListenerWithOptions(target, type, handler, options) {
var optionsOrCapture = options; var optionsOrCapture = options || {};
if (!supportsCaptureOption) { if (!supportsCaptureOption) {
optionsOrCapture = options.capture; optionsOrCapture = optionsOrCapture.capture;
} }
target.removeEventListener(type, handler, optionsOrCapture); target.removeEventListener(type, handler, optionsOrCapture);
} }