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

This commit is contained in:
Jenkins 2016-12-12 23:38:37 +00:00 committed by Gerrit Code Review
commit 1dc560a9fd

View File

@ -57,16 +57,9 @@ horizon.forms = {
$volName.val($option.data("name"));
}
var $volSize = $form.find('input#id_size');
var volSize = parseInt($volSize.val(), 10) || -1;
var dataSize = parseInt($option.data("size"), 10) || -1;
var minDiskSize = parseInt($option.data("min_disk"), 10) || -1;
var defaultVolSize = dataSize;
if (minDiskSize > defaultVolSize) {
defaultVolSize = minDiskSize;
}
if (volSize < defaultVolSize) {
$volSize.val(defaultVolSize);
}
var minDiskSize = parseInt($option.data("min_disk"), 10) || 1;
$volSize.val(Math.max(minDiskSize, dataSize));
});
},