WebClient: hide submit button in profile page if no change is allowed

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-05-03 18:38:13 +02:00
parent a1af33c6aa
commit 92aa89263b
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -185,6 +185,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
</div>
</div>
{{- end}}
{{if .CanSubmit}}
<div class="d-flex justify-content-end mt-12">
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
<button type="submit" id="form_submit" class="btn btn-primary px-10">
@ -197,6 +198,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
</span>
</button>
</div>
{{- end}}
</form>
</div>
</div>
@ -218,11 +220,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
initRepeaterItems();
//{{- end}}
//{{if .CanSubmit}}
$("#page_form").submit(function (event) {
let submitButton = document.querySelector('#form_submit');
submitButton.setAttribute('data-kt-indicator', 'on');
submitButton.disabled = true;
});
//{{- end}}
});
</script>
{{- end}}