Browse Source

Merge "The minimum volume size should be pre-populated"

tags/11.0.0.0b2^0
Jenkins 2 years ago
parent
commit
1dc560a9fd
1 changed files with 2 additions and 9 deletions
  1. 2
    9
      horizon/static/horizon/js/horizon.forms.js

+ 2
- 9
horizon/static/horizon/js/horizon.forms.js View File

@@ -57,16 +57,9 @@ horizon.forms = {
57 57
         $volName.val($option.data("name"));
58 58
       }
59 59
       var $volSize = $form.find('input#id_size');
60
-      var volSize = parseInt($volSize.val(), 10) || -1;
61 60
       var dataSize = parseInt($option.data("size"), 10) || -1;
62
-      var minDiskSize = parseInt($option.data("min_disk"), 10) || -1;
63
-      var defaultVolSize = dataSize;
64
-      if (minDiskSize > defaultVolSize) {
65
-        defaultVolSize = minDiskSize;
66
-      }
67
-      if (volSize < defaultVolSize) {
68
-        $volSize.val(defaultVolSize);
69
-      }
61
+      var minDiskSize = parseInt($option.data("min_disk"), 10) || 1;
62
+      $volSize.val(Math.max(minDiskSize, dataSize));
70 63
     });
71 64
   },
72 65
 

Loading…
Cancel
Save