瀏覽代碼

FD3-754 fix

Guillermo Espinoza 6 年之前
父節點
當前提交
6bf6af19e7
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/HostBundle/Resources/views/CRUD/edit.html.twig

+ 6 - 3
src/HostBundle/Resources/views/CRUD/edit.html.twig

@@ -49,11 +49,14 @@ function showHostField()
 
         $hostField.hide();
     } else {
-        if ($hostSelect.find("option[value='']").length) {
+        var val = $hostSelect.val();
+        if (val == '' && $hostSelect.find("option[value='']").length) {
             $hostSelect.find("option[value='']").remove();
         }
-        var val = $hostSelect.find("option").first().attr('value');
-        $hostSelect.val(val).trigger('change');
+        if (val == '') {
+            val = $hostSelect.find("option").first().attr('value');
+            $hostSelect.val(val).trigger('change');
+        }
 
         $hostField.show();
     }