2017-03-02 18:23:23 +08:00
|
|
|
$(document).ready(function() {
|
|
|
|
// add.php
|
|
|
|
// Get max. possible quota for a domain when domain field changes
|
|
|
|
$('#addSelectDomain').on('change', function() {
|
2017-04-27 14:44:21 +08:00
|
|
|
$.get("/api/v1/get/domain/" + this.value, function(data){
|
2017-04-30 04:19:35 +08:00
|
|
|
var result = $.parseJSON(JSON.stringify(data));
|
2017-03-02 18:23:23 +08:00
|
|
|
max_new_mailbox_quota = ( result.max_new_mailbox_quota / 1048576);
|
|
|
|
if (max_new_mailbox_quota != '0') {
|
|
|
|
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
|
|
|
$('#addInputQuota').attr({"disabled": false, "value": "", "type": "number", "max": max_new_mailbox_quota});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
|
|
|
$('#addInputQuota').attr({"disabled": true, "value": "", "type": "text", "value": "n/a"});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|