]> www.vanbest.org Git - motioneye-debian/commitdiff
add camera dialog: clear the camera select box each time the camera type
authorCalin Crisan <ccrisan@gmail.com>
Sun, 19 Jul 2015 12:53:14 +0000 (15:53 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 19 Jul 2015 12:53:14 +0000 (15:53 +0300)
is changed

static/js/main.js

index 656951f2621a36b9d3b1529512d88e1860fe48e7..beabd444f1587634c57d44d59d42ae44524d719e 100644 (file)
@@ -2859,8 +2859,6 @@ function runAddCameraDialog() {
                 return;
             }
             
-            addCameraSelect.html('');
-            
             if (data.error || !data.cameras) {
                 return;
             }
@@ -2878,12 +2876,16 @@ function runAddCameraDialog() {
         });
     }
     
+    typeSelect.change(function () {
+        addCameraSelect.html('');
+    });
+    
     typeSelect.change(updateUi);
     urlEntry.change(updateUi);
     usernameEntry.change(updateUi);
     passwordEntry.change(updateUi);
     updateUi();
-    
+
     runModalDialog({
         title: 'Add Camera...',
         closeButton: true,