mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
Merge branch 'master' into feature-13011/installation_on_multiple_servers
This commit is contained in:
@@ -3,6 +3,8 @@ const ANRECHNUNGSTATUS_REJECTED = 'rejected';
|
||||
const HERKUNFT_DER_KENNTNISSE_MAX_LENGTH = 125;
|
||||
|
||||
$(function(){
|
||||
const uploadMaxFilesize = $('#requestAnrechnung-uploadfile').data('maxsize') ; // in byte
|
||||
|
||||
// Set status alert color
|
||||
requestAnrechnung.setStatusAlertColor();
|
||||
|
||||
@@ -26,6 +28,12 @@ $(function(){
|
||||
// Avoid form redirecting automatically
|
||||
e.preventDefault();
|
||||
|
||||
var fileInput = $('#requestAnrechnung-uploadfile');
|
||||
if (!requestAnrechnung.fileSizeOk(fileInput, uploadMaxFilesize)) // in byte
|
||||
{
|
||||
return FHC_DialogLib.alertWarning(FHC_PhrasesLib.t("ui", "errorDokumentZuGross"));
|
||||
}
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
FHC_JS_DATA_STORAGE_OBJECT.called_path + "/apply",
|
||||
{
|
||||
@@ -161,5 +169,19 @@ var requestAnrechnung = {
|
||||
|
||||
// Disable all form elements
|
||||
$("#requestAnrechnung-form :input").prop("disabled", true);
|
||||
},
|
||||
fileSizeOk: function(fileInput, maxSize){
|
||||
|
||||
if (fileInput.get(0).files.length){
|
||||
|
||||
var fileSize = fileInput.get(0).files[0].size; // in bytes
|
||||
|
||||
if (fileSize > maxSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user