2016-12-09 20:39:02 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
// add.php
|
|
|
|
// Get max. possible quota for a domain when domain field changes
|
|
|
|
$('#addSelectDomain').on('change', function() {
|
2017-01-21 11:49:29 +01:00
|
|
|
$.get("json_api.php", { action:"get_domain_details", object:this.value }, function(data){
|
|
|
|
var result = jQuery.parseJSON( data );
|
|
|
|
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});
|
2016-12-09 20:39:02 +01:00
|
|
|
}
|
|
|
|
else {
|
2017-01-21 11:49:29 +01:00
|
|
|
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
2016-12-09 20:39:02 +01:00
|
|
|
$('#addInputQuota').attr({"disabled": true, "value": "", "type": "text", "value": "n/a"});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|