summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-12 23:38:37 +0000
committerGerrit Code Review <review@openstack.org>2016-12-12 23:38:37 +0000
commit1dc560a9fdf57ed3ccb2efd360154e9326588f2c (patch)
treec1b4648b641b3771855be6ecc9bf3ba65e723c82
parent7fcb0cf67662b167a87511bca79f7e30cfc1d9f9 (diff)
parentcd2a7907be0f2762ea5dca4a13171d66429519c0 (diff)
Merge "The minimum volume size should be pre-populated"11.0.0.0b2
-rw-r--r--horizon/static/horizon/js/horizon.forms.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js
index e202855..825bf05 100644
--- a/horizon/static/horizon/js/horizon.forms.js
+++ b/horizon/static/horizon/js/horizon.forms.js
@@ -57,16 +57,9 @@ horizon.forms = {
57 $volName.val($option.data("name")); 57 $volName.val($option.data("name"));
58 } 58 }
59 var $volSize = $form.find('input#id_size'); 59 var $volSize = $form.find('input#id_size');
60 var volSize = parseInt($volSize.val(), 10) || -1;
61 var dataSize = parseInt($option.data("size"), 10) || -1; 60 var dataSize = parseInt($option.data("size"), 10) || -1;
62 var minDiskSize = parseInt($option.data("min_disk"), 10) || -1; 61 var minDiskSize = parseInt($option.data("min_disk"), 10) || 1;
63 var defaultVolSize = dataSize; 62 $volSize.val(Math.max(minDiskSize, dataSize));
64 if (minDiskSize > defaultVolSize) {
65 defaultVolSize = minDiskSize;
66 }
67 if (volSize < defaultVolSize) {
68 $volSize.val(defaultVolSize);
69 }
70 }); 63 });
71 }, 64 },
72 65