jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/fullscreen/fullscreen-doubleclick.js
Luke Pulverenti 7d8f6339a2 update osd
2017-01-04 01:49:00 -05:00

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
});
});