]> www.vanbest.org Git - motioneye-debian/commitdiff
prevent pushing camera config changes unless a camera is selected
authorCalin Crisan <ccrisan@gmail.com>
Sun, 16 Aug 2015 14:37:40 +0000 (17:37 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 16 Aug 2015 14:37:40 +0000 (17:37 +0300)
static/css/ui.css
static/js/main.js

index 7c77c83ac29d93b855595252966aeec1f9032b37..f114a8bd483a6e0b2a641d5c469f0252119215f2 100644 (file)
@@ -201,7 +201,6 @@ select.styled {
     background-position: right center;
     cursor: pointer;
     vertical-align: middle;
-    transition: all 0.1s ease;
 }
 
 select.styled:FOCUS {
index 569d93fc9cbc1219aa927732dc89467271cb812c..ecdf58f350433bb52a10290e0ee429449d1872f2 100644 (file)
@@ -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;