From: Calin Crisan Date: Sun, 16 Aug 2015 14:37:40 +0000 (+0300) Subject: prevent pushing camera config changes unless a camera is selected X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=6af892faeed5509551458c84b3720586f8f3522a;p=motioneye-debian prevent pushing camera config changes unless a camera is selected --- diff --git a/static/css/ui.css b/static/css/ui.css index 7c77c83..f114a8b 100644 --- a/static/css/ui.css +++ b/static/css/ui.css @@ -201,7 +201,6 @@ select.styled { background-position: right center; cursor: pointer; vertical-align: middle; - transition: all 0.1s ease; } select.styled:FOCUS { diff --git a/static/js/main.js b/static/js/main.js index 569d93f..ecdf58f 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1841,7 +1841,7 @@ function doApply() { if (config.proto == 'netcam' || config.proto == 'v4l2') { instance = ''; } - else { /* motioneye */ + else if (config.proto == 'motioneye') { /* motioneye */ instance = config.host || ''; if (config.port) { instance += ':' + config.port; @@ -2363,6 +2363,10 @@ function pushMainConfig(reboot) { function pushCameraConfig(reboot) { var cameraConfig = cameraUi2Dict(); var cameraId = $('#cameraSelect').val(); + + if (!cameraId) { + return; /* event triggered without a selected camera */ + } pushConfigReboot = pushConfigReboot || reboot; pushConfigs[cameraId] = cameraConfig;