mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
26 lines
616 B
JavaScript
26 lines
616 B
JavaScript
define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) {
|
|
'use strict';
|
|
|
|
function isTargetValid(target) {
|
|
|
|
if (dom.parentWithTag(target, ['BUTTON', 'INPUT', 'TEXTAREA'])) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
dom.addEventListener(window, 'dblclick', function (e) {
|
|
|
|
if (isTargetValid(e.target)) {
|
|
if (fullscreenManager.isFullScreen()) {
|
|
fullscreenManager.exitFullscreen();
|
|
} else {
|
|
fullscreenManager.requestFullscreen();
|
|
}
|
|
}
|
|
|
|
}, {
|
|
passive: true
|
|
});
|
|
}); |