This repository has been archived on 2023-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/assets/js/cameraImgViewHelper.js
2020-02-20 11:18:09 +00:00

18 lines
542 B
JavaScript

function fixCameraImgView() {
var img = document.getElementsByTagName('img');
if (img && img.length) {
img[0].setAttribute('width', document.body.clientWidth);
img[0].setAttribute('style', 'margin-top: ' + ((document.body.clientHeight - img[0].offsetHeight) / 2));
}
var ovrl = document.getElementById('appOverlay');
if (ovrl) {
ovrl.remove();
}
}
window.bodyDetectInterval = setInterval(function() {
if (document.body != null) {
setTimeout(fixCameraImgView, 1000);
}
}, 100);