1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/fullscreen/fullscreen-doubleclick.js

26 lines
616 B
JavaScript
Raw Normal View History

2016-09-03 13:58:23 -04:00
define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) {
2016-10-18 01:06:48 -04:00
'use strict';
2016-09-03 13:58:23 -04:00
2017-01-04 01:49:00 -05:00
function isTargetValid(target) {
2016-09-03 13:58:23 -04:00
2017-01-04 01:49:00 -05:00
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();
}
2016-09-03 13:58:23 -04:00
}
}, {
passive: true
});
});