mirror of http://git.sublab.org/cctv-control/
new init-function
This commit is contained in:
parent
f51686fe12
commit
70506cc35a
|
@ -21,7 +21,7 @@ var formActive = false;
|
||||||
window.onDomReady = initReady;
|
window.onDomReady = initReady;
|
||||||
|
|
||||||
//change from testbild to default cam when DOM is ready
|
//change from testbild to default cam when DOM is ready
|
||||||
window.onDomReady(changeCam);
|
window.onDomReady(initViewer);
|
||||||
|
|
||||||
function initReady(fn) {
|
function initReady(fn) {
|
||||||
if(document.addEventListener) {
|
if(document.addEventListener) {
|
||||||
|
@ -29,11 +29,15 @@ function initReady(fn) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//hide the form, and switch on camera
|
||||||
|
function initViewer() {
|
||||||
|
document.getElementById('form').style.visibility = "hidden";
|
||||||
|
changeCam();
|
||||||
|
}
|
||||||
|
|
||||||
//change currently displayed camera to the one in cam variable
|
//change currently displayed camera to the one in cam variable
|
||||||
function changeCam() {
|
function changeCam() {
|
||||||
|
|
||||||
document.getElementById('form').style.visibility = "hidden";
|
|
||||||
|
|
||||||
var display = document.getElementById('screen');
|
var display = document.getElementById('screen');
|
||||||
if (cam <= 7 && cam >= 0) {
|
if (cam <= 7 && cam >= 0) {
|
||||||
camDisplay = cam + 1;
|
camDisplay = cam + 1;
|
||||||
|
|
Loading…
Reference in New Issue